(FPCore (vel velAxis pos poxAxis) :precision binary64 (+ (* (- vel velAxis) 0.05) (* (- pos poxAxis) 300.0)))
double code(double vel, double velAxis, double pos, double poxAxis) { return ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0); }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis code = ((vel - velaxis) * 0.05d0) + ((pos - poxaxis) * 300.0d0) end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { return ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0); }
def code(vel, velAxis, pos, poxAxis): return ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0)
function code(vel, velAxis, pos, poxAxis) return Float64(Float64(Float64(vel - velAxis) * 0.05) + Float64(Float64(pos - poxAxis) * 300.0)) end
function tmp = code(vel, velAxis, pos, poxAxis) tmp = ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0); end
code[vel_, velAxis_, pos_, poxAxis_] := N[(N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision] + N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \left(vel - velAxis\right) \cdot 0.05 + \left(pos - poxAxis\right) \cdot 300 \end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (vel velAxis pos poxAxis) :precision binary64 (+ (* (- vel velAxis) 0.05) (* (- pos poxAxis) 300.0)))
double code(double vel, double velAxis, double pos, double poxAxis) { return ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0); }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis code = ((vel - velaxis) * 0.05d0) + ((pos - poxaxis) * 300.0d0) end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { return ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0); }
def code(vel, velAxis, pos, poxAxis): return ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0)
function code(vel, velAxis, pos, poxAxis) return Float64(Float64(Float64(vel - velAxis) * 0.05) + Float64(Float64(pos - poxAxis) * 300.0)) end
function tmp = code(vel, velAxis, pos, poxAxis) tmp = ((vel - velAxis) * 0.05) + ((pos - poxAxis) * 300.0); end
code[vel_, velAxis_, pos_, poxAxis_] := N[(N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision] + N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \left(vel - velAxis\right) \cdot 0.05 + \left(pos - poxAxis\right) \cdot 300 \end{array}
(FPCore (vel velAxis pos poxAxis) :precision binary64 (fma vel 0.05 (fma -0.05 velAxis (* (- pos poxAxis) 300.0))))
double code(double vel, double velAxis, double pos, double poxAxis) { return fma(vel, 0.05, fma(-0.05, velAxis, ((pos - poxAxis) * 300.0))); }
function code(vel, velAxis, pos, poxAxis) return fma(vel, 0.05, fma(-0.05, velAxis, Float64(Float64(pos - poxAxis) * 300.0))) end
code[vel_, velAxis_, pos_, poxAxis_] := N[(vel * 0.05 + N[(-0.05 * velAxis + N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \mathsf{fma}\left(vel, 0.05, \mathsf{fma}\left(-0.05, velAxis, \left(pos - poxAxis\right) \cdot 300\right)\right) \end{array}
Initial program 99.9%
lift-+.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lift--.f64
N/A
sub-neg
N/A
distribute-lft-in
N/A
associate-+l+
N/A
*-commutative
N/A
lower-fma.f64
N/A
neg-mul-1
N/A
associate-*r*
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
100.0
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
100.0
Applied rewrites100.0%
Final simplification100.0%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (if (<= pos -9.8e-118) (* pos 300.0) (if (<= pos -2.5e-144) (* -300.0 poxAxis) (if (<= pos -1.8e-253) (* velAxis -0.05) (if (<= pos 4.9e-279) (* -300.0 poxAxis) (if (<= pos 3.5e-175) (* 0.05 vel) (if (<= pos 3.5e-112) (* velAxis -0.05) (* pos 300.0))))))))
double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -9.8e-118) { tmp = pos * 300.0; } else if (pos <= -2.5e-144) { tmp = -300.0 * poxAxis; } else if (pos <= -1.8e-253) { tmp = velAxis * -0.05; } else if (pos <= 4.9e-279) { tmp = -300.0 * poxAxis; } else if (pos <= 3.5e-175) { tmp = 0.05 * vel; } else if (pos <= 3.5e-112) { tmp = velAxis * -0.05; } else { tmp = pos * 300.0; } return tmp; }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis real(8) :: tmp if (pos <= (-9.8d-118)) then tmp = pos * 300.0d0 else if (pos <= (-2.5d-144)) then tmp = (-300.0d0) * poxaxis else if (pos <= (-1.8d-253)) then tmp = velaxis * (-0.05d0) else if (pos <= 4.9d-279) then tmp = (-300.0d0) * poxaxis else if (pos <= 3.5d-175) then tmp = 0.05d0 * vel else if (pos <= 3.5d-112) then tmp = velaxis * (-0.05d0) else tmp = pos * 300.0d0 end if code = tmp end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -9.8e-118) { tmp = pos * 300.0; } else if (pos <= -2.5e-144) { tmp = -300.0 * poxAxis; } else if (pos <= -1.8e-253) { tmp = velAxis * -0.05; } else if (pos <= 4.9e-279) { tmp = -300.0 * poxAxis; } else if (pos <= 3.5e-175) { tmp = 0.05 * vel; } else if (pos <= 3.5e-112) { tmp = velAxis * -0.05; } else { tmp = pos * 300.0; } return tmp; }
def code(vel, velAxis, pos, poxAxis): tmp = 0 if pos <= -9.8e-118: tmp = pos * 300.0 elif pos <= -2.5e-144: tmp = -300.0 * poxAxis elif pos <= -1.8e-253: tmp = velAxis * -0.05 elif pos <= 4.9e-279: tmp = -300.0 * poxAxis elif pos <= 3.5e-175: tmp = 0.05 * vel elif pos <= 3.5e-112: tmp = velAxis * -0.05 else: tmp = pos * 300.0 return tmp
function code(vel, velAxis, pos, poxAxis) tmp = 0.0 if (pos <= -9.8e-118) tmp = Float64(pos * 300.0); elseif (pos <= -2.5e-144) tmp = Float64(-300.0 * poxAxis); elseif (pos <= -1.8e-253) tmp = Float64(velAxis * -0.05); elseif (pos <= 4.9e-279) tmp = Float64(-300.0 * poxAxis); elseif (pos <= 3.5e-175) tmp = Float64(0.05 * vel); elseif (pos <= 3.5e-112) tmp = Float64(velAxis * -0.05); else tmp = Float64(pos * 300.0); end return tmp end
function tmp_2 = code(vel, velAxis, pos, poxAxis) tmp = 0.0; if (pos <= -9.8e-118) tmp = pos * 300.0; elseif (pos <= -2.5e-144) tmp = -300.0 * poxAxis; elseif (pos <= -1.8e-253) tmp = velAxis * -0.05; elseif (pos <= 4.9e-279) tmp = -300.0 * poxAxis; elseif (pos <= 3.5e-175) tmp = 0.05 * vel; elseif (pos <= 3.5e-112) tmp = velAxis * -0.05; else tmp = pos * 300.0; end tmp_2 = tmp; end
code[vel_, velAxis_, pos_, poxAxis_] := If[LessEqual[pos, -9.8e-118], N[(pos * 300.0), $MachinePrecision], If[LessEqual[pos, -2.5e-144], N[(-300.0 * poxAxis), $MachinePrecision], If[LessEqual[pos, -1.8e-253], N[(velAxis * -0.05), $MachinePrecision], If[LessEqual[pos, 4.9e-279], N[(-300.0 * poxAxis), $MachinePrecision], If[LessEqual[pos, 3.5e-175], N[(0.05 * vel), $MachinePrecision], If[LessEqual[pos, 3.5e-112], N[(velAxis * -0.05), $MachinePrecision], N[(pos * 300.0), $MachinePrecision]]]]]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;pos \leq -9.8 \cdot 10^{-118}:\\ \;\;\;\;pos \cdot 300\\ \mathbf{elif}\;pos \leq -2.5 \cdot 10^{-144}:\\ \;\;\;\;-300 \cdot poxAxis\\ \mathbf{elif}\;pos \leq -1.8 \cdot 10^{-253}:\\ \;\;\;\;velAxis \cdot -0.05\\ \mathbf{elif}\;pos \leq 4.9 \cdot 10^{-279}:\\ \;\;\;\;-300 \cdot poxAxis\\ \mathbf{elif}\;pos \leq 3.5 \cdot 10^{-175}:\\ \;\;\;\;0.05 \cdot vel\\ \mathbf{elif}\;pos \leq 3.5 \cdot 10^{-112}:\\ \;\;\;\;velAxis \cdot -0.05\\ \mathbf{else}:\\ \;\;\;\;pos \cdot 300\\ \end{array} \end{array}
if pos < -9.7999999999999995e-118 or 3.49999999999999994e-112 < pos
Initial program 99.9%
Taylor expanded in pos around inf
*-commutative
N/A
lower-*.f64
59.2
Applied rewrites59.2%
if -9.7999999999999995e-118 < pos < -2.4999999999999999e-144 or -1.8e-253 < pos < 4.89999999999999974e-279
Initial program 100.0%
Taylor expanded in poxAxis around inf
*-commutative
N/A
lower-*.f64
54.9
Applied rewrites54.9%
if -2.4999999999999999e-144 < pos < -1.8e-253 or 3.49999999999999999e-175 < pos < 3.49999999999999994e-112
Initial program 99.9%
Taylor expanded in velAxis around inf
lower-*.f64
57.4
Applied rewrites57.4%
if 4.89999999999999974e-279 < pos < 3.49999999999999999e-175
Initial program 99.9%
Taylor expanded in vel around inf
*-commutative
N/A
lower-*.f64
52.8
Applied rewrites52.8%
Final simplification57.1%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (if (<= pos -9.8e-118) (* pos 300.0) (if (<= pos -2.5e-144) (* -300.0 poxAxis) (if (<= pos -1.8e-253) (* velAxis -0.05) (if (<= pos 3.4e-190) (* -300.0 poxAxis) (if (<= pos 3.5e-112) (* velAxis -0.05) (* pos 300.0)))))))
double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -9.8e-118) { tmp = pos * 300.0; } else if (pos <= -2.5e-144) { tmp = -300.0 * poxAxis; } else if (pos <= -1.8e-253) { tmp = velAxis * -0.05; } else if (pos <= 3.4e-190) { tmp = -300.0 * poxAxis; } else if (pos <= 3.5e-112) { tmp = velAxis * -0.05; } else { tmp = pos * 300.0; } return tmp; }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis real(8) :: tmp if (pos <= (-9.8d-118)) then tmp = pos * 300.0d0 else if (pos <= (-2.5d-144)) then tmp = (-300.0d0) * poxaxis else if (pos <= (-1.8d-253)) then tmp = velaxis * (-0.05d0) else if (pos <= 3.4d-190) then tmp = (-300.0d0) * poxaxis else if (pos <= 3.5d-112) then tmp = velaxis * (-0.05d0) else tmp = pos * 300.0d0 end if code = tmp end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -9.8e-118) { tmp = pos * 300.0; } else if (pos <= -2.5e-144) { tmp = -300.0 * poxAxis; } else if (pos <= -1.8e-253) { tmp = velAxis * -0.05; } else if (pos <= 3.4e-190) { tmp = -300.0 * poxAxis; } else if (pos <= 3.5e-112) { tmp = velAxis * -0.05; } else { tmp = pos * 300.0; } return tmp; }
def code(vel, velAxis, pos, poxAxis): tmp = 0 if pos <= -9.8e-118: tmp = pos * 300.0 elif pos <= -2.5e-144: tmp = -300.0 * poxAxis elif pos <= -1.8e-253: tmp = velAxis * -0.05 elif pos <= 3.4e-190: tmp = -300.0 * poxAxis elif pos <= 3.5e-112: tmp = velAxis * -0.05 else: tmp = pos * 300.0 return tmp
function code(vel, velAxis, pos, poxAxis) tmp = 0.0 if (pos <= -9.8e-118) tmp = Float64(pos * 300.0); elseif (pos <= -2.5e-144) tmp = Float64(-300.0 * poxAxis); elseif (pos <= -1.8e-253) tmp = Float64(velAxis * -0.05); elseif (pos <= 3.4e-190) tmp = Float64(-300.0 * poxAxis); elseif (pos <= 3.5e-112) tmp = Float64(velAxis * -0.05); else tmp = Float64(pos * 300.0); end return tmp end
function tmp_2 = code(vel, velAxis, pos, poxAxis) tmp = 0.0; if (pos <= -9.8e-118) tmp = pos * 300.0; elseif (pos <= -2.5e-144) tmp = -300.0 * poxAxis; elseif (pos <= -1.8e-253) tmp = velAxis * -0.05; elseif (pos <= 3.4e-190) tmp = -300.0 * poxAxis; elseif (pos <= 3.5e-112) tmp = velAxis * -0.05; else tmp = pos * 300.0; end tmp_2 = tmp; end
code[vel_, velAxis_, pos_, poxAxis_] := If[LessEqual[pos, -9.8e-118], N[(pos * 300.0), $MachinePrecision], If[LessEqual[pos, -2.5e-144], N[(-300.0 * poxAxis), $MachinePrecision], If[LessEqual[pos, -1.8e-253], N[(velAxis * -0.05), $MachinePrecision], If[LessEqual[pos, 3.4e-190], N[(-300.0 * poxAxis), $MachinePrecision], If[LessEqual[pos, 3.5e-112], N[(velAxis * -0.05), $MachinePrecision], N[(pos * 300.0), $MachinePrecision]]]]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;pos \leq -9.8 \cdot 10^{-118}:\\ \;\;\;\;pos \cdot 300\\ \mathbf{elif}\;pos \leq -2.5 \cdot 10^{-144}:\\ \;\;\;\;-300 \cdot poxAxis\\ \mathbf{elif}\;pos \leq -1.8 \cdot 10^{-253}:\\ \;\;\;\;velAxis \cdot -0.05\\ \mathbf{elif}\;pos \leq 3.4 \cdot 10^{-190}:\\ \;\;\;\;-300 \cdot poxAxis\\ \mathbf{elif}\;pos \leq 3.5 \cdot 10^{-112}:\\ \;\;\;\;velAxis \cdot -0.05\\ \mathbf{else}:\\ \;\;\;\;pos \cdot 300\\ \end{array} \end{array}
if pos < -9.7999999999999995e-118 or 3.49999999999999994e-112 < pos
Initial program 99.9%
Taylor expanded in pos around inf
*-commutative
N/A
lower-*.f64
59.2
Applied rewrites59.2%
if -9.7999999999999995e-118 < pos < -2.4999999999999999e-144 or -1.8e-253 < pos < 3.39999999999999981e-190
Initial program 99.9%
Taylor expanded in poxAxis around inf
*-commutative
N/A
lower-*.f64
45.9
Applied rewrites45.9%
if -2.4999999999999999e-144 < pos < -1.8e-253 or 3.39999999999999981e-190 < pos < 3.49999999999999994e-112
Initial program 99.9%
Taylor expanded in velAxis around inf
lower-*.f64
54.3
Applied rewrites54.3%
Final simplification54.0%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (if (<= pos -2.5e-116) (fma vel 0.05 (fma -0.05 velAxis (* pos 300.0))) (if (<= pos 1.65e-112) (fma poxAxis -300.0 (* (- vel velAxis) 0.05)) (fma vel 0.05 (* (- pos poxAxis) 300.0)))))
double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -2.5e-116) { tmp = fma(vel, 0.05, fma(-0.05, velAxis, (pos * 300.0))); } else if (pos <= 1.65e-112) { tmp = fma(poxAxis, -300.0, ((vel - velAxis) * 0.05)); } else { tmp = fma(vel, 0.05, ((pos - poxAxis) * 300.0)); } return tmp; }
function code(vel, velAxis, pos, poxAxis) tmp = 0.0 if (pos <= -2.5e-116) tmp = fma(vel, 0.05, fma(-0.05, velAxis, Float64(pos * 300.0))); elseif (pos <= 1.65e-112) tmp = fma(poxAxis, -300.0, Float64(Float64(vel - velAxis) * 0.05)); else tmp = fma(vel, 0.05, Float64(Float64(pos - poxAxis) * 300.0)); end return tmp end
code[vel_, velAxis_, pos_, poxAxis_] := If[LessEqual[pos, -2.5e-116], N[(vel * 0.05 + N[(-0.05 * velAxis + N[(pos * 300.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[pos, 1.65e-112], N[(poxAxis * -300.0 + N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision]), $MachinePrecision], N[(vel * 0.05 + N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;pos \leq -2.5 \cdot 10^{-116}:\\ \;\;\;\;\mathsf{fma}\left(vel, 0.05, \mathsf{fma}\left(-0.05, velAxis, pos \cdot 300\right)\right)\\ \mathbf{elif}\;pos \leq 1.65 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(poxAxis, -300, \left(vel - velAxis\right) \cdot 0.05\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(vel, 0.05, \left(pos - poxAxis\right) \cdot 300\right)\\ \end{array} \end{array}
if pos < -2.5000000000000001e-116
Initial program 99.8%
lift-+.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lift--.f64
N/A
sub-neg
N/A
distribute-lft-in
N/A
associate-+l+
N/A
*-commutative
N/A
lower-fma.f64
N/A
neg-mul-1
N/A
associate-*r*
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
99.9
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
99.9
Applied rewrites99.9%
Taylor expanded in poxAxis around 0
*-commutative
N/A
lower-*.f64
91.7
Applied rewrites91.7%
if -2.5000000000000001e-116 < pos < 1.65e-112
Initial program 99.9%
Taylor expanded in pos around 0
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
96.9
Applied rewrites96.9%
if 1.65e-112 < pos
Initial program 100.0%
lift-+.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lift--.f64
N/A
sub-neg
N/A
distribute-lft-in
N/A
associate-+l+
N/A
*-commutative
N/A
lower-fma.f64
N/A
neg-mul-1
N/A
associate-*r*
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
100.0
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
100.0
Applied rewrites100.0%
Taylor expanded in velAxis around 0
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
90.3
Applied rewrites90.3%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (let* ((t_0 (* (- vel velAxis) 0.05))) (if (<= pos -2.5e-116) (fma pos 300.0 t_0) (if (<= pos 1.65e-112) (fma poxAxis -300.0 t_0) (fma vel 0.05 (* (- pos poxAxis) 300.0))))))
double code(double vel, double velAxis, double pos, double poxAxis) { double t_0 = (vel - velAxis) * 0.05; double tmp; if (pos <= -2.5e-116) { tmp = fma(pos, 300.0, t_0); } else if (pos <= 1.65e-112) { tmp = fma(poxAxis, -300.0, t_0); } else { tmp = fma(vel, 0.05, ((pos - poxAxis) * 300.0)); } return tmp; }
function code(vel, velAxis, pos, poxAxis) t_0 = Float64(Float64(vel - velAxis) * 0.05) tmp = 0.0 if (pos <= -2.5e-116) tmp = fma(pos, 300.0, t_0); elseif (pos <= 1.65e-112) tmp = fma(poxAxis, -300.0, t_0); else tmp = fma(vel, 0.05, Float64(Float64(pos - poxAxis) * 300.0)); end return tmp end
code[vel_, velAxis_, pos_, poxAxis_] := Block[{t$95$0 = N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision]}, If[LessEqual[pos, -2.5e-116], N[(pos * 300.0 + t$95$0), $MachinePrecision], If[LessEqual[pos, 1.65e-112], N[(poxAxis * -300.0 + t$95$0), $MachinePrecision], N[(vel * 0.05 + N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l} \\ \begin{array}{l} t_0 := \left(vel - velAxis\right) \cdot 0.05\\ \mathbf{if}\;pos \leq -2.5 \cdot 10^{-116}:\\ \;\;\;\;\mathsf{fma}\left(pos, 300, t\_0\right)\\ \mathbf{elif}\;pos \leq 1.65 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(poxAxis, -300, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(vel, 0.05, \left(pos - poxAxis\right) \cdot 300\right)\\ \end{array} \end{array}
if pos < -2.5000000000000001e-116
Initial program 99.8%
Taylor expanded in poxAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
91.6
Applied rewrites91.6%
if -2.5000000000000001e-116 < pos < 1.65e-112
Initial program 99.9%
Taylor expanded in pos around 0
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
96.9
Applied rewrites96.9%
if 1.65e-112 < pos
Initial program 100.0%
lift-+.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lift--.f64
N/A
sub-neg
N/A
distribute-lft-in
N/A
associate-+l+
N/A
*-commutative
N/A
lower-fma.f64
N/A
neg-mul-1
N/A
associate-*r*
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
100.0
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
100.0
Applied rewrites100.0%
Taylor expanded in velAxis around 0
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
90.3
Applied rewrites90.3%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (let* ((t_0 (* (- vel velAxis) 0.05))) (if (<= pos -2.5e-116) (fma pos 300.0 t_0) (if (<= pos 1.65e-112) (fma poxAxis -300.0 t_0) (fma (- pos poxAxis) 300.0 (* 0.05 vel))))))
double code(double vel, double velAxis, double pos, double poxAxis) { double t_0 = (vel - velAxis) * 0.05; double tmp; if (pos <= -2.5e-116) { tmp = fma(pos, 300.0, t_0); } else if (pos <= 1.65e-112) { tmp = fma(poxAxis, -300.0, t_0); } else { tmp = fma((pos - poxAxis), 300.0, (0.05 * vel)); } return tmp; }
function code(vel, velAxis, pos, poxAxis) t_0 = Float64(Float64(vel - velAxis) * 0.05) tmp = 0.0 if (pos <= -2.5e-116) tmp = fma(pos, 300.0, t_0); elseif (pos <= 1.65e-112) tmp = fma(poxAxis, -300.0, t_0); else tmp = fma(Float64(pos - poxAxis), 300.0, Float64(0.05 * vel)); end return tmp end
code[vel_, velAxis_, pos_, poxAxis_] := Block[{t$95$0 = N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision]}, If[LessEqual[pos, -2.5e-116], N[(pos * 300.0 + t$95$0), $MachinePrecision], If[LessEqual[pos, 1.65e-112], N[(poxAxis * -300.0 + t$95$0), $MachinePrecision], N[(N[(pos - poxAxis), $MachinePrecision] * 300.0 + N[(0.05 * vel), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l} \\ \begin{array}{l} t_0 := \left(vel - velAxis\right) \cdot 0.05\\ \mathbf{if}\;pos \leq -2.5 \cdot 10^{-116}:\\ \;\;\;\;\mathsf{fma}\left(pos, 300, t\_0\right)\\ \mathbf{elif}\;pos \leq 1.65 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(poxAxis, -300, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(pos - poxAxis, 300, 0.05 \cdot vel\right)\\ \end{array} \end{array}
if pos < -2.5000000000000001e-116
Initial program 99.8%
Taylor expanded in poxAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
91.6
Applied rewrites91.6%
if -2.5000000000000001e-116 < pos < 1.65e-112
Initial program 99.9%
Taylor expanded in pos around 0
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
96.9
Applied rewrites96.9%
if 1.65e-112 < pos
Initial program 100.0%
Taylor expanded in velAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower--.f64
N/A
*-commutative
N/A
lower-*.f64
90.3
Applied rewrites90.3%
Final simplification94.4%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (let* ((t_0 (* (- vel velAxis) 0.05)) (t_1 (fma pos 300.0 t_0))) (if (<= pos -2.5e-116) t_1 (if (<= pos 7.5e-120) (fma poxAxis -300.0 t_0) t_1))))
double code(double vel, double velAxis, double pos, double poxAxis) { double t_0 = (vel - velAxis) * 0.05; double t_1 = fma(pos, 300.0, t_0); double tmp; if (pos <= -2.5e-116) { tmp = t_1; } else if (pos <= 7.5e-120) { tmp = fma(poxAxis, -300.0, t_0); } else { tmp = t_1; } return tmp; }
function code(vel, velAxis, pos, poxAxis) t_0 = Float64(Float64(vel - velAxis) * 0.05) t_1 = fma(pos, 300.0, t_0) tmp = 0.0 if (pos <= -2.5e-116) tmp = t_1; elseif (pos <= 7.5e-120) tmp = fma(poxAxis, -300.0, t_0); else tmp = t_1; end return tmp end
code[vel_, velAxis_, pos_, poxAxis_] := Block[{t$95$0 = N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision]}, Block[{t$95$1 = N[(pos * 300.0 + t$95$0), $MachinePrecision]}, If[LessEqual[pos, -2.5e-116], t$95$1, If[LessEqual[pos, 7.5e-120], N[(poxAxis * -300.0 + t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l} \\ \begin{array}{l} t_0 := \left(vel - velAxis\right) \cdot 0.05\\ t_1 := \mathsf{fma}\left(pos, 300, t\_0\right)\\ \mathbf{if}\;pos \leq -2.5 \cdot 10^{-116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;pos \leq 7.5 \cdot 10^{-120}:\\ \;\;\;\;\mathsf{fma}\left(poxAxis, -300, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array}
if pos < -2.5000000000000001e-116 or 7.5000000000000004e-120 < pos
Initial program 99.9%
Taylor expanded in poxAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
90.0
Applied rewrites90.0%
if -2.5000000000000001e-116 < pos < 7.5000000000000004e-120
Initial program 99.9%
Taylor expanded in pos around 0
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
96.9
Applied rewrites96.9%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (if (<= poxAxis -7.6e-49) (* (- pos poxAxis) 300.0) (if (<= poxAxis 4.15e-88) (fma pos 300.0 (* (- vel velAxis) 0.05)) (fma poxAxis -300.0 (* 0.05 vel)))))
double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (poxAxis <= -7.6e-49) { tmp = (pos - poxAxis) * 300.0; } else if (poxAxis <= 4.15e-88) { tmp = fma(pos, 300.0, ((vel - velAxis) * 0.05)); } else { tmp = fma(poxAxis, -300.0, (0.05 * vel)); } return tmp; }
function code(vel, velAxis, pos, poxAxis) tmp = 0.0 if (poxAxis <= -7.6e-49) tmp = Float64(Float64(pos - poxAxis) * 300.0); elseif (poxAxis <= 4.15e-88) tmp = fma(pos, 300.0, Float64(Float64(vel - velAxis) * 0.05)); else tmp = fma(poxAxis, -300.0, Float64(0.05 * vel)); end return tmp end
code[vel_, velAxis_, pos_, poxAxis_] := If[LessEqual[poxAxis, -7.6e-49], N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision], If[LessEqual[poxAxis, 4.15e-88], N[(pos * 300.0 + N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision]), $MachinePrecision], N[(poxAxis * -300.0 + N[(0.05 * vel), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;poxAxis \leq -7.6 \cdot 10^{-49}:\\ \;\;\;\;\left(pos - poxAxis\right) \cdot 300\\ \mathbf{elif}\;poxAxis \leq 4.15 \cdot 10^{-88}:\\ \;\;\;\;\mathsf{fma}\left(pos, 300, \left(vel - velAxis\right) \cdot 0.05\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(poxAxis, -300, 0.05 \cdot vel\right)\\ \end{array} \end{array}
if poxAxis < -7.5999999999999994e-49
Initial program 99.9%
Taylor expanded in velAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower--.f64
N/A
*-commutative
N/A
lower-*.f64
89.6
Applied rewrites89.6%
Taylor expanded in vel around 0
Applied rewrites89.6%
if -7.5999999999999994e-49 < poxAxis < 4.15e-88
Initial program 99.9%
Taylor expanded in poxAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
89.7
Applied rewrites89.7%
if 4.15e-88 < poxAxis
Initial program 99.9%
Taylor expanded in velAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower--.f64
N/A
*-commutative
N/A
lower-*.f64
97.1
Applied rewrites97.1%
Taylor expanded in pos around 0
Applied rewrites78.3%
Final simplification88.2%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (if (<= (- vel velAxis) -5e-73) (fma vel 0.05 (* velAxis -0.05)) (if (<= (- vel velAxis) 4e-95) (* (- pos poxAxis) 300.0) (* (- vel velAxis) 0.05))))
double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if ((vel - velAxis) <= -5e-73) { tmp = fma(vel, 0.05, (velAxis * -0.05)); } else if ((vel - velAxis) <= 4e-95) { tmp = (pos - poxAxis) * 300.0; } else { tmp = (vel - velAxis) * 0.05; } return tmp; }
function code(vel, velAxis, pos, poxAxis) tmp = 0.0 if (Float64(vel - velAxis) <= -5e-73) tmp = fma(vel, 0.05, Float64(velAxis * -0.05)); elseif (Float64(vel - velAxis) <= 4e-95) tmp = Float64(Float64(pos - poxAxis) * 300.0); else tmp = Float64(Float64(vel - velAxis) * 0.05); end return tmp end
code[vel_, velAxis_, pos_, poxAxis_] := If[LessEqual[N[(vel - velAxis), $MachinePrecision], -5e-73], N[(vel * 0.05 + N[(velAxis * -0.05), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(vel - velAxis), $MachinePrecision], 4e-95], N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision], N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;vel - velAxis \leq -5 \cdot 10^{-73}:\\ \;\;\;\;\mathsf{fma}\left(vel, 0.05, velAxis \cdot -0.05\right)\\ \mathbf{elif}\;vel - velAxis \leq 4 \cdot 10^{-95}:\\ \;\;\;\;\left(pos - poxAxis\right) \cdot 300\\ \mathbf{else}:\\ \;\;\;\;\left(vel - velAxis\right) \cdot 0.05\\ \end{array} \end{array}
if (-.f64 vel velAxis) < -4.9999999999999998e-73
Initial program 99.9%
lift-+.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lift--.f64
N/A
sub-neg
N/A
distribute-lft-in
N/A
associate-+l+
N/A
*-commutative
N/A
lower-fma.f64
N/A
neg-mul-1
N/A
associate-*r*
N/A
metadata-eval
N/A
metadata-eval
N/A
lower-fma.f64
N/A
metadata-eval
99.9
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
99.9
Applied rewrites99.9%
Taylor expanded in velAxis around inf
*-commutative
N/A
lower-*.f64
71.3
Applied rewrites71.3%
if -4.9999999999999998e-73 < (-.f64 vel velAxis) < 3.99999999999999996e-95
Initial program 100.0%
Taylor expanded in velAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower--.f64
N/A
*-commutative
N/A
lower-*.f64
86.8
Applied rewrites86.8%
Taylor expanded in vel around 0
Applied rewrites76.8%
if 3.99999999999999996e-95 < (-.f64 vel velAxis)
Initial program 99.9%
Taylor expanded in poxAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
85.0
Applied rewrites85.0%
Taylor expanded in pos around 0
Applied rewrites76.8%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (let* ((t_0 (* (- vel velAxis) 0.05))) (if (<= (- vel velAxis) -5e-73) t_0 (if (<= (- vel velAxis) 4e-95) (* (- pos poxAxis) 300.0) t_0))))
double code(double vel, double velAxis, double pos, double poxAxis) { double t_0 = (vel - velAxis) * 0.05; double tmp; if ((vel - velAxis) <= -5e-73) { tmp = t_0; } else if ((vel - velAxis) <= 4e-95) { tmp = (pos - poxAxis) * 300.0; } else { tmp = t_0; } return tmp; }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis real(8) :: t_0 real(8) :: tmp t_0 = (vel - velaxis) * 0.05d0 if ((vel - velaxis) <= (-5d-73)) then tmp = t_0 else if ((vel - velaxis) <= 4d-95) then tmp = (pos - poxaxis) * 300.0d0 else tmp = t_0 end if code = tmp end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { double t_0 = (vel - velAxis) * 0.05; double tmp; if ((vel - velAxis) <= -5e-73) { tmp = t_0; } else if ((vel - velAxis) <= 4e-95) { tmp = (pos - poxAxis) * 300.0; } else { tmp = t_0; } return tmp; }
def code(vel, velAxis, pos, poxAxis): t_0 = (vel - velAxis) * 0.05 tmp = 0 if (vel - velAxis) <= -5e-73: tmp = t_0 elif (vel - velAxis) <= 4e-95: tmp = (pos - poxAxis) * 300.0 else: tmp = t_0 return tmp
function code(vel, velAxis, pos, poxAxis) t_0 = Float64(Float64(vel - velAxis) * 0.05) tmp = 0.0 if (Float64(vel - velAxis) <= -5e-73) tmp = t_0; elseif (Float64(vel - velAxis) <= 4e-95) tmp = Float64(Float64(pos - poxAxis) * 300.0); else tmp = t_0; end return tmp end
function tmp_2 = code(vel, velAxis, pos, poxAxis) t_0 = (vel - velAxis) * 0.05; tmp = 0.0; if ((vel - velAxis) <= -5e-73) tmp = t_0; elseif ((vel - velAxis) <= 4e-95) tmp = (pos - poxAxis) * 300.0; else tmp = t_0; end tmp_2 = tmp; end
code[vel_, velAxis_, pos_, poxAxis_] := Block[{t$95$0 = N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision]}, If[LessEqual[N[(vel - velAxis), $MachinePrecision], -5e-73], t$95$0, If[LessEqual[N[(vel - velAxis), $MachinePrecision], 4e-95], N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision], t$95$0]]]
\begin{array}{l} \\ \begin{array}{l} t_0 := \left(vel - velAxis\right) \cdot 0.05\\ \mathbf{if}\;vel - velAxis \leq -5 \cdot 10^{-73}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;vel - velAxis \leq 4 \cdot 10^{-95}:\\ \;\;\;\;\left(pos - poxAxis\right) \cdot 300\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array}
if (-.f64 vel velAxis) < -4.9999999999999998e-73 or 3.99999999999999996e-95 < (-.f64 vel velAxis)
Initial program 99.9%
Taylor expanded in poxAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
87.1
Applied rewrites87.1%
Taylor expanded in pos around 0
Applied rewrites74.4%
if -4.9999999999999998e-73 < (-.f64 vel velAxis) < 3.99999999999999996e-95
Initial program 100.0%
Taylor expanded in velAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
lower--.f64
N/A
*-commutative
N/A
lower-*.f64
86.8
Applied rewrites86.8%
Taylor expanded in vel around 0
Applied rewrites76.8%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (if (<= pos -3.5e-61) (* pos 300.0) (if (<= pos 1.4e-103) (* (- vel velAxis) 0.05) (* pos 300.0))))
double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -3.5e-61) { tmp = pos * 300.0; } else if (pos <= 1.4e-103) { tmp = (vel - velAxis) * 0.05; } else { tmp = pos * 300.0; } return tmp; }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis real(8) :: tmp if (pos <= (-3.5d-61)) then tmp = pos * 300.0d0 else if (pos <= 1.4d-103) then tmp = (vel - velaxis) * 0.05d0 else tmp = pos * 300.0d0 end if code = tmp end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -3.5e-61) { tmp = pos * 300.0; } else if (pos <= 1.4e-103) { tmp = (vel - velAxis) * 0.05; } else { tmp = pos * 300.0; } return tmp; }
def code(vel, velAxis, pos, poxAxis): tmp = 0 if pos <= -3.5e-61: tmp = pos * 300.0 elif pos <= 1.4e-103: tmp = (vel - velAxis) * 0.05 else: tmp = pos * 300.0 return tmp
function code(vel, velAxis, pos, poxAxis) tmp = 0.0 if (pos <= -3.5e-61) tmp = Float64(pos * 300.0); elseif (pos <= 1.4e-103) tmp = Float64(Float64(vel - velAxis) * 0.05); else tmp = Float64(pos * 300.0); end return tmp end
function tmp_2 = code(vel, velAxis, pos, poxAxis) tmp = 0.0; if (pos <= -3.5e-61) tmp = pos * 300.0; elseif (pos <= 1.4e-103) tmp = (vel - velAxis) * 0.05; else tmp = pos * 300.0; end tmp_2 = tmp; end
code[vel_, velAxis_, pos_, poxAxis_] := If[LessEqual[pos, -3.5e-61], N[(pos * 300.0), $MachinePrecision], If[LessEqual[pos, 1.4e-103], N[(N[(vel - velAxis), $MachinePrecision] * 0.05), $MachinePrecision], N[(pos * 300.0), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;pos \leq -3.5 \cdot 10^{-61}:\\ \;\;\;\;pos \cdot 300\\ \mathbf{elif}\;pos \leq 1.4 \cdot 10^{-103}:\\ \;\;\;\;\left(vel - velAxis\right) \cdot 0.05\\ \mathbf{else}:\\ \;\;\;\;pos \cdot 300\\ \end{array} \end{array}
if pos < -3.5000000000000003e-61 or 1.40000000000000011e-103 < pos
Initial program 99.9%
Taylor expanded in pos around inf
*-commutative
N/A
lower-*.f64
73.0
Applied rewrites73.0%
if -3.5000000000000003e-61 < pos < 1.40000000000000011e-103
Initial program 99.9%
Taylor expanded in poxAxis around 0
+-commutative
N/A
*-commutative
N/A
lower-fma.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower--.f64
70.6
Applied rewrites70.6%
Taylor expanded in pos around 0
Applied rewrites61.1%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (if (<= pos -2.85e-108) (* pos 300.0) (if (<= pos 3.5e-112) (* velAxis -0.05) (* pos 300.0))))
double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -2.85e-108) { tmp = pos * 300.0; } else if (pos <= 3.5e-112) { tmp = velAxis * -0.05; } else { tmp = pos * 300.0; } return tmp; }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis real(8) :: tmp if (pos <= (-2.85d-108)) then tmp = pos * 300.0d0 else if (pos <= 3.5d-112) then tmp = velaxis * (-0.05d0) else tmp = pos * 300.0d0 end if code = tmp end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { double tmp; if (pos <= -2.85e-108) { tmp = pos * 300.0; } else if (pos <= 3.5e-112) { tmp = velAxis * -0.05; } else { tmp = pos * 300.0; } return tmp; }
def code(vel, velAxis, pos, poxAxis): tmp = 0 if pos <= -2.85e-108: tmp = pos * 300.0 elif pos <= 3.5e-112: tmp = velAxis * -0.05 else: tmp = pos * 300.0 return tmp
function code(vel, velAxis, pos, poxAxis) tmp = 0.0 if (pos <= -2.85e-108) tmp = Float64(pos * 300.0); elseif (pos <= 3.5e-112) tmp = Float64(velAxis * -0.05); else tmp = Float64(pos * 300.0); end return tmp end
function tmp_2 = code(vel, velAxis, pos, poxAxis) tmp = 0.0; if (pos <= -2.85e-108) tmp = pos * 300.0; elseif (pos <= 3.5e-112) tmp = velAxis * -0.05; else tmp = pos * 300.0; end tmp_2 = tmp; end
code[vel_, velAxis_, pos_, poxAxis_] := If[LessEqual[pos, -2.85e-108], N[(pos * 300.0), $MachinePrecision], If[LessEqual[pos, 3.5e-112], N[(velAxis * -0.05), $MachinePrecision], N[(pos * 300.0), $MachinePrecision]]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;pos \leq -2.85 \cdot 10^{-108}:\\ \;\;\;\;pos \cdot 300\\ \mathbf{elif}\;pos \leq 3.5 \cdot 10^{-112}:\\ \;\;\;\;velAxis \cdot -0.05\\ \mathbf{else}:\\ \;\;\;\;pos \cdot 300\\ \end{array} \end{array}
if pos < -2.85e-108 or 3.49999999999999994e-112 < pos
Initial program 99.9%
Taylor expanded in pos around inf
*-commutative
N/A
lower-*.f64
60.9
Applied rewrites60.9%
if -2.85e-108 < pos < 3.49999999999999994e-112
Initial program 99.9%
Taylor expanded in velAxis around inf
lower-*.f64
37.0
Applied rewrites37.0%
Final simplification47.0%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (fma (- vel velAxis) 0.05 (* (- pos poxAxis) 300.0)))
double code(double vel, double velAxis, double pos, double poxAxis) { return fma((vel - velAxis), 0.05, ((pos - poxAxis) * 300.0)); }
function code(vel, velAxis, pos, poxAxis) return fma(Float64(vel - velAxis), 0.05, Float64(Float64(pos - poxAxis) * 300.0)) end
code[vel_, velAxis_, pos_, poxAxis_] := N[(N[(vel - velAxis), $MachinePrecision] * 0.05 + N[(N[(pos - poxAxis), $MachinePrecision] * 300.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \mathsf{fma}\left(vel - velAxis, 0.05, \left(pos - poxAxis\right) \cdot 300\right) \end{array}
Initial program 99.9%
lift-+.f64
N/A
lift-*.f64
N/A
lower-fma.f64
99.9
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
99.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (vel velAxis pos poxAxis) :precision binary64 (* velAxis -0.05))
double code(double vel, double velAxis, double pos, double poxAxis) { return velAxis * -0.05; }
real(8) function code(vel, velaxis, pos, poxaxis) real(8), intent (in) :: vel real(8), intent (in) :: velaxis real(8), intent (in) :: pos real(8), intent (in) :: poxaxis code = velaxis * (-0.05d0) end function
public static double code(double vel, double velAxis, double pos, double poxAxis) { return velAxis * -0.05; }
def code(vel, velAxis, pos, poxAxis): return velAxis * -0.05
function code(vel, velAxis, pos, poxAxis) return Float64(velAxis * -0.05) end
function tmp = code(vel, velAxis, pos, poxAxis) tmp = velAxis * -0.05; end
code[vel_, velAxis_, pos_, poxAxis_] := N[(velAxis * -0.05), $MachinePrecision]
\begin{array}{l} \\ velAxis \cdot -0.05 \end{array}
Initial program 99.9%
Taylor expanded in velAxis around inf
lower-*.f64
27.9
Applied rewrites27.9%
Final simplification27.9%
herbie shell --seed 1
(FPCore (vel velAxis pos poxAxis)
:name "(vel-velAxis)*0.05+(pos-poxAxis)*300"
:precision binary64
:pre (and (and (and (and (<= -10000000000.0 vel) (<= vel 10000000000.0)) (and (<= -10000000000.0 velAxis) (<= velAxis 10000000000.0))) (and (<= -10000000000.0 pos) (<= pos 10000000000.0))) (and (<= -10000000000.0 poxAxis) (<= poxAxis 10000000000.0)))
(+ (* (- vel velAxis) 0.05) (* (- pos poxAxis) 300.0)))