
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (* (- x y) (/ 60.0 (- z t))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((x - y) * (60.0 / (z - t))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x - y) * (60.0d0 / (z - t))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x - y) * (60.0 / (z - t))) + (a * 120.0);
}
def code(x, y, z, t, a): return ((x - y) * (60.0 / (z - t))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x - y) * (60.0 / (z - t))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - y\right) \cdot \frac{60}{z - t} + a \cdot 120
\end{array}
Initial program 98.0%
*-commutative98.0%
associate-/l*99.8%
Applied egg-rr99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (<= t_1 -2e+17)
(/ 60.0 (/ (- z t) (- x y)))
(if (<= t_1 3.3e-151)
(* a 120.0)
(if (<= t_1 5e+31)
(+ (* a 120.0) (* x (/ -60.0 t)))
(* 60.0 (/ (- x y) (- z t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+17) {
tmp = 60.0 / ((z - t) / (x - y));
} else if (t_1 <= 3.3e-151) {
tmp = a * 120.0;
} else if (t_1 <= 5e+31) {
tmp = (a * 120.0) + (x * (-60.0 / t));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((x - y) * 60.0d0) / (z - t)
if (t_1 <= (-2d+17)) then
tmp = 60.0d0 / ((z - t) / (x - y))
else if (t_1 <= 3.3d-151) then
tmp = a * 120.0d0
else if (t_1 <= 5d+31) then
tmp = (a * 120.0d0) + (x * ((-60.0d0) / t))
else
tmp = 60.0d0 * ((x - y) / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+17) {
tmp = 60.0 / ((z - t) / (x - y));
} else if (t_1 <= 3.3e-151) {
tmp = a * 120.0;
} else if (t_1 <= 5e+31) {
tmp = (a * 120.0) + (x * (-60.0 / t));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_1 <= -2e+17: tmp = 60.0 / ((z - t) / (x - y)) elif t_1 <= 3.3e-151: tmp = a * 120.0 elif t_1 <= 5e+31: tmp = (a * 120.0) + (x * (-60.0 / t)) else: tmp = 60.0 * ((x - y) / (z - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+17) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); elseif (t_1 <= 3.3e-151) tmp = Float64(a * 120.0); elseif (t_1 <= 5e+31) tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(-60.0 / t))); else tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_1 <= -2e+17) tmp = 60.0 / ((z - t) / (x - y)); elseif (t_1 <= 3.3e-151) tmp = a * 120.0; elseif (t_1 <= 5e+31) tmp = (a * 120.0) + (x * (-60.0 / t)); else tmp = 60.0 * ((x - y) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+17], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 3.3e-151], N[(a * 120.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+31], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+17}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{elif}\;t\_1 \leq 3.3 \cdot 10^{-151}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+31}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{-60}{t}\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e17Initial program 95.7%
associate-/l*99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in a around 0 82.5%
clear-num82.5%
un-div-inv82.6%
Applied egg-rr82.6%
if -2e17 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 3.2999999999999999e-151Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 82.0%
if 3.2999999999999999e-151 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000027e31Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 82.1%
Taylor expanded in z around 0 63.4%
if 5.00000000000000027e31 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 94.9%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 83.6%
Final simplification79.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* x (/ -60.0 t)))))
(if (<= t -1.8e-6)
t_1
(if (<= t -1.7e-177)
(* 60.0 (/ (- x y) (- z t)))
(if (<= t -1.9e-235)
(+ (* a 120.0) (/ (* x 60.0) z))
(if (<= t 1.75e-56) (+ (* a 120.0) (* -60.0 (/ y z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (x * (-60.0 / t));
double tmp;
if (t <= -1.8e-6) {
tmp = t_1;
} else if (t <= -1.7e-177) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t <= -1.9e-235) {
tmp = (a * 120.0) + ((x * 60.0) / z);
} else if (t <= 1.75e-56) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (a * 120.0d0) + (x * ((-60.0d0) / t))
if (t <= (-1.8d-6)) then
tmp = t_1
else if (t <= (-1.7d-177)) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if (t <= (-1.9d-235)) then
tmp = (a * 120.0d0) + ((x * 60.0d0) / z)
else if (t <= 1.75d-56) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (x * (-60.0 / t));
double tmp;
if (t <= -1.8e-6) {
tmp = t_1;
} else if (t <= -1.7e-177) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t <= -1.9e-235) {
tmp = (a * 120.0) + ((x * 60.0) / z);
} else if (t <= 1.75e-56) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (x * (-60.0 / t)) tmp = 0 if t <= -1.8e-6: tmp = t_1 elif t <= -1.7e-177: tmp = 60.0 * ((x - y) / (z - t)) elif t <= -1.9e-235: tmp = (a * 120.0) + ((x * 60.0) / z) elif t <= 1.75e-56: tmp = (a * 120.0) + (-60.0 * (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(x * Float64(-60.0 / t))) tmp = 0.0 if (t <= -1.8e-6) tmp = t_1; elseif (t <= -1.7e-177) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (t <= -1.9e-235) tmp = Float64(Float64(a * 120.0) + Float64(Float64(x * 60.0) / z)); elseif (t <= 1.75e-56) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (x * (-60.0 / t)); tmp = 0.0; if (t <= -1.8e-6) tmp = t_1; elseif (t <= -1.7e-177) tmp = 60.0 * ((x - y) / (z - t)); elseif (t <= -1.9e-235) tmp = (a * 120.0) + ((x * 60.0) / z); elseif (t <= 1.75e-56) tmp = (a * 120.0) + (-60.0 * (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.8e-6], t$95$1, If[LessEqual[t, -1.7e-177], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.9e-235], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x * 60.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-56], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + x \cdot \frac{-60}{t}\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-177}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-235}:\\
\;\;\;\;a \cdot 120 + \frac{x \cdot 60}{z}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-56}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.79999999999999992e-6 or 1.7499999999999999e-56 < t Initial program 97.0%
*-commutative97.0%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 80.7%
Taylor expanded in z around 0 72.9%
if -1.79999999999999992e-6 < t < -1.7e-177Initial program 96.5%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 79.8%
if -1.7e-177 < t < -1.90000000000000013e-235Initial program 100.0%
Taylor expanded in z around inf 90.8%
Taylor expanded in x around inf 85.2%
if -1.90000000000000013e-235 < t < 1.7499999999999999e-56Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 89.5%
associate-*r/89.5%
remove-double-neg89.5%
neg-mul-189.5%
times-frac89.5%
metadata-eval89.5%
neg-sub089.5%
sub-neg89.5%
+-commutative89.5%
associate--r+89.5%
neg-sub089.5%
remove-double-neg89.5%
Simplified89.5%
Taylor expanded in t around 0 85.5%
Final simplification78.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* x (/ -60.0 t)))))
(if (<= t -5.6e-5)
t_1
(if (<= t -1.3e-179)
(* 60.0 (/ (- x y) (- z t)))
(if (<= t -8e-236)
(+ (* a 120.0) (* x (/ 60.0 z)))
(if (<= t 5.8e-57) (+ (* a 120.0) (* -60.0 (/ y z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (x * (-60.0 / t));
double tmp;
if (t <= -5.6e-5) {
tmp = t_1;
} else if (t <= -1.3e-179) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t <= -8e-236) {
tmp = (a * 120.0) + (x * (60.0 / z));
} else if (t <= 5.8e-57) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (a * 120.0d0) + (x * ((-60.0d0) / t))
if (t <= (-5.6d-5)) then
tmp = t_1
else if (t <= (-1.3d-179)) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if (t <= (-8d-236)) then
tmp = (a * 120.0d0) + (x * (60.0d0 / z))
else if (t <= 5.8d-57) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (x * (-60.0 / t));
double tmp;
if (t <= -5.6e-5) {
tmp = t_1;
} else if (t <= -1.3e-179) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t <= -8e-236) {
tmp = (a * 120.0) + (x * (60.0 / z));
} else if (t <= 5.8e-57) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (x * (-60.0 / t)) tmp = 0 if t <= -5.6e-5: tmp = t_1 elif t <= -1.3e-179: tmp = 60.0 * ((x - y) / (z - t)) elif t <= -8e-236: tmp = (a * 120.0) + (x * (60.0 / z)) elif t <= 5.8e-57: tmp = (a * 120.0) + (-60.0 * (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(x * Float64(-60.0 / t))) tmp = 0.0 if (t <= -5.6e-5) tmp = t_1; elseif (t <= -1.3e-179) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (t <= -8e-236) tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / z))); elseif (t <= 5.8e-57) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (x * (-60.0 / t)); tmp = 0.0; if (t <= -5.6e-5) tmp = t_1; elseif (t <= -1.3e-179) tmp = 60.0 * ((x - y) / (z - t)); elseif (t <= -8e-236) tmp = (a * 120.0) + (x * (60.0 / z)); elseif (t <= 5.8e-57) tmp = (a * 120.0) + (-60.0 * (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e-5], t$95$1, If[LessEqual[t, -1.3e-179], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8e-236], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-57], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + x \cdot \frac{-60}{t}\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-179}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-236}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-57}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.59999999999999992e-5 or 5.8000000000000005e-57 < t Initial program 97.0%
*-commutative97.0%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 80.7%
Taylor expanded in z around 0 72.9%
if -5.59999999999999992e-5 < t < -1.30000000000000003e-179Initial program 96.5%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 79.8%
if -1.30000000000000003e-179 < t < -8.0000000000000004e-236Initial program 100.0%
*-commutative100.0%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 80.3%
Taylor expanded in z around inf 85.1%
if -8.0000000000000004e-236 < t < 5.8000000000000005e-57Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 89.5%
associate-*r/89.5%
remove-double-neg89.5%
neg-mul-189.5%
times-frac89.5%
metadata-eval89.5%
neg-sub089.5%
sub-neg89.5%
+-commutative89.5%
associate--r+89.5%
neg-sub089.5%
remove-double-neg89.5%
Simplified89.5%
Taylor expanded in t around 0 85.5%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- x y) -5e+22) (not (<= (- x y) 1e+156))) (* 60.0 (/ (- x y) (- z t))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x - y) <= -5e+22) || !((x - y) <= 1e+156)) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((x - y) <= (-5d+22)) .or. (.not. ((x - y) <= 1d+156))) then
tmp = 60.0d0 * ((x - y) / (z - t))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x - y) <= -5e+22) || !((x - y) <= 1e+156)) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((x - y) <= -5e+22) or not ((x - y) <= 1e+156): tmp = 60.0 * ((x - y) / (z - t)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(x - y) <= -5e+22) || !(Float64(x - y) <= 1e+156)) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((x - y) <= -5e+22) || ~(((x - y) <= 1e+156))) tmp = 60.0 * ((x - y) / (z - t)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(x - y), $MachinePrecision], -5e+22], N[Not[LessEqual[N[(x - y), $MachinePrecision], 1e+156]], $MachinePrecision]], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x - y \leq -5 \cdot 10^{+22} \lor \neg \left(x - y \leq 10^{+156}\right):\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (-.f64 x y) < -4.9999999999999996e22 or 9.9999999999999998e155 < (-.f64 x y) Initial program 96.5%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 72.0%
if -4.9999999999999996e22 < (-.f64 x y) < 9.9999999999999998e155Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.5%
Final simplification74.8%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -1e-71)
(* a 120.0)
(if (<= (* a 120.0) 5e-65)
(* 60.0 (/ (- x y) (- z t)))
(+ (* a 120.0) (* -60.0 (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e-71) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 5e-65) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = (a * 120.0) + (-60.0 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a * 120.0d0) <= (-1d-71)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 5d-65) then
tmp = 60.0d0 * ((x - y) / (z - t))
else
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e-71) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 5e-65) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = (a * 120.0) + (-60.0 * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -1e-71: tmp = a * 120.0 elif (a * 120.0) <= 5e-65: tmp = 60.0 * ((x - y) / (z - t)) else: tmp = (a * 120.0) + (-60.0 * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e-71) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 5e-65) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -1e-71) tmp = a * 120.0; elseif ((a * 120.0) <= 5e-65) tmp = 60.0 * ((x - y) / (z - t)); else tmp = (a * 120.0) + (-60.0 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-71], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-65], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-71}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{-65}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.9999999999999992e-72Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 72.5%
if -9.9999999999999992e-72 < (*.f64 a #s(literal 120 binary64)) < 4.99999999999999983e-65Initial program 97.1%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 78.9%
if 4.99999999999999983e-65 < (*.f64 a #s(literal 120 binary64)) Initial program 97.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 87.5%
associate-*r/86.2%
remove-double-neg86.2%
neg-mul-186.2%
times-frac87.5%
metadata-eval87.5%
neg-sub087.5%
sub-neg87.5%
+-commutative87.5%
associate--r+87.5%
neg-sub087.5%
remove-double-neg87.5%
Simplified87.5%
Taylor expanded in t around 0 71.8%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.3e+28) (not (<= y 1.25e+27))) (+ (* a 120.0) (* 60.0 (/ y (- t z)))) (+ (* a 120.0) (* x (/ 60.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.3e+28) || !(y <= 1.25e+27)) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} else {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-3.3d+28)) .or. (.not. (y <= 1.25d+27))) then
tmp = (a * 120.0d0) + (60.0d0 * (y / (t - z)))
else
tmp = (a * 120.0d0) + (x * (60.0d0 / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.3e+28) || !(y <= 1.25e+27)) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} else {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.3e+28) or not (y <= 1.25e+27): tmp = (a * 120.0) + (60.0 * (y / (t - z))) else: tmp = (a * 120.0) + (x * (60.0 / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.3e+28) || !(y <= 1.25e+27)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / Float64(t - z)))); else tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.3e+28) || ~((y <= 1.25e+27))) tmp = (a * 120.0) + (60.0 * (y / (t - z))); else tmp = (a * 120.0) + (x * (60.0 / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.3e+28], N[Not[LessEqual[y, 1.25e+27]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+28} \lor \neg \left(y \leq 1.25 \cdot 10^{+27}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if y < -3.3e28 or 1.24999999999999995e27 < y Initial program 96.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 89.4%
associate-*r/86.9%
remove-double-neg86.9%
neg-mul-186.9%
times-frac89.4%
metadata-eval89.4%
neg-sub089.4%
sub-neg89.4%
+-commutative89.4%
associate--r+89.4%
neg-sub089.4%
remove-double-neg89.4%
Simplified89.4%
if -3.3e28 < y < 1.24999999999999995e27Initial program 99.2%
*-commutative99.2%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 96.3%
Final simplification93.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -4e+141) (not (<= x 3.6e+163))) (/ 60.0 (/ (- z t) (- x y))) (+ (* a 120.0) (* 60.0 (/ y (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4e+141) || !(x <= 3.6e+163)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-4d+141)) .or. (.not. (x <= 3.6d+163))) then
tmp = 60.0d0 / ((z - t) / (x - y))
else
tmp = (a * 120.0d0) + (60.0d0 * (y / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4e+141) || !(x <= 3.6e+163)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -4e+141) or not (x <= 3.6e+163): tmp = 60.0 / ((z - t) / (x - y)) else: tmp = (a * 120.0) + (60.0 * (y / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -4e+141) || !(x <= 3.6e+163)) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -4e+141) || ~((x <= 3.6e+163))) tmp = 60.0 / ((z - t) / (x - y)); else tmp = (a * 120.0) + (60.0 * (y / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -4e+141], N[Not[LessEqual[x, 3.6e+163]], $MachinePrecision]], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+141} \lor \neg \left(x \leq 3.6 \cdot 10^{+163}\right):\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if x < -4.00000000000000007e141 or 3.59999999999999978e163 < x Initial program 93.4%
associate-/l*99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in a around 0 82.3%
clear-num82.4%
un-div-inv82.4%
Applied egg-rr82.4%
if -4.00000000000000007e141 < x < 3.59999999999999978e163Initial program 99.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 90.1%
associate-*r/89.6%
remove-double-neg89.6%
neg-mul-189.6%
times-frac90.1%
metadata-eval90.1%
neg-sub090.1%
sub-neg90.1%
+-commutative90.1%
associate--r+90.1%
neg-sub090.1%
remove-double-neg90.1%
Simplified90.1%
Final simplification88.3%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.1e+30)
(+ (* a 120.0) (* 60.0 (/ y (- t z))))
(if (<= y 1.8e+27)
(+ (* a 120.0) (* x (/ 60.0 (- z t))))
(+ (* a 120.0) (* y (/ 60.0 (- t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.1e+30) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} else if (y <= 1.8e+27) {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
} else {
tmp = (a * 120.0) + (y * (60.0 / (t - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-2.1d+30)) then
tmp = (a * 120.0d0) + (60.0d0 * (y / (t - z)))
else if (y <= 1.8d+27) then
tmp = (a * 120.0d0) + (x * (60.0d0 / (z - t)))
else
tmp = (a * 120.0d0) + (y * (60.0d0 / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.1e+30) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} else if (y <= 1.8e+27) {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
} else {
tmp = (a * 120.0) + (y * (60.0 / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.1e+30: tmp = (a * 120.0) + (60.0 * (y / (t - z))) elif y <= 1.8e+27: tmp = (a * 120.0) + (x * (60.0 / (z - t))) else: tmp = (a * 120.0) + (y * (60.0 / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.1e+30) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / Float64(t - z)))); elseif (y <= 1.8e+27) tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t)))); else tmp = Float64(Float64(a * 120.0) + Float64(y * Float64(60.0 / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.1e+30) tmp = (a * 120.0) + (60.0 * (y / (t - z))); elseif (y <= 1.8e+27) tmp = (a * 120.0) + (x * (60.0 / (z - t))); else tmp = (a * 120.0) + (y * (60.0 / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.1e+30], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+27], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(y * N[(60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+30}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t - z}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+27}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{60}{t - z}\\
\end{array}
\end{array}
if y < -2.1e30Initial program 98.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 90.4%
associate-*r/88.6%
remove-double-neg88.6%
neg-mul-188.6%
times-frac90.4%
metadata-eval90.4%
neg-sub090.4%
sub-neg90.4%
+-commutative90.4%
associate--r+90.4%
neg-sub090.4%
remove-double-neg90.4%
Simplified90.4%
if -2.1e30 < y < 1.79999999999999991e27Initial program 99.2%
*-commutative99.2%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 96.3%
if 1.79999999999999991e27 < y Initial program 95.1%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 88.6%
associate-*r/85.5%
remove-double-neg85.5%
neg-mul-185.5%
times-frac88.6%
metadata-eval88.6%
neg-sub088.6%
sub-neg88.6%
+-commutative88.6%
associate--r+88.6%
neg-sub088.6%
remove-double-neg88.6%
Simplified88.6%
clear-num88.6%
un-div-inv88.6%
Applied egg-rr88.6%
associate-/r/88.7%
Applied egg-rr88.7%
Final simplification93.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.7e+110) (not (<= y 7.4e+86))) (* 60.0 (/ y (- t z))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.7e+110) || !(y <= 7.4e+86)) {
tmp = 60.0 * (y / (t - z));
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-3.7d+110)) .or. (.not. (y <= 7.4d+86))) then
tmp = 60.0d0 * (y / (t - z))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.7e+110) || !(y <= 7.4e+86)) {
tmp = 60.0 * (y / (t - z));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.7e+110) or not (y <= 7.4e+86): tmp = 60.0 * (y / (t - z)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.7e+110) || !(y <= 7.4e+86)) tmp = Float64(60.0 * Float64(y / Float64(t - z))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.7e+110) || ~((y <= 7.4e+86))) tmp = 60.0 * (y / (t - z)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.7e+110], N[Not[LessEqual[y, 7.4e+86]], $MachinePrecision]], N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+110} \lor \neg \left(y \leq 7.4 \cdot 10^{+86}\right):\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -3.70000000000000012e110 or 7.39999999999999983e86 < y Initial program 95.4%
associate-/l*99.8%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 73.1%
Taylor expanded in x around 0 64.3%
associate-*r/87.6%
remove-double-neg87.6%
neg-mul-187.6%
times-frac90.9%
metadata-eval90.9%
neg-sub090.9%
sub-neg90.9%
+-commutative90.9%
associate--r+90.9%
neg-sub090.9%
remove-double-neg90.9%
Simplified64.3%
if -3.70000000000000012e110 < y < 7.39999999999999983e86Initial program 99.3%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around inf 62.4%
Final simplification63.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.2e+142) (not (<= x 2.9e+164))) (* x (/ -60.0 t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.2e+142) || !(x <= 2.9e+164)) {
tmp = x * (-60.0 / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-2.2d+142)) .or. (.not. (x <= 2.9d+164))) then
tmp = x * ((-60.0d0) / t)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.2e+142) || !(x <= 2.9e+164)) {
tmp = x * (-60.0 / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -2.2e+142) or not (x <= 2.9e+164): tmp = x * (-60.0 / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.2e+142) || !(x <= 2.9e+164)) tmp = Float64(x * Float64(-60.0 / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -2.2e+142) || ~((x <= 2.9e+164))) tmp = x * (-60.0 / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.2e+142], N[Not[LessEqual[x, 2.9e+164]], $MachinePrecision]], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+142} \lor \neg \left(x \leq 2.9 \cdot 10^{+164}\right):\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -2.19999999999999987e142 or 2.8999999999999999e164 < x Initial program 93.4%
associate-/l*99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in x around inf 93.2%
Taylor expanded in x around inf 69.6%
Taylor expanded in z around 0 44.0%
if -2.19999999999999987e142 < x < 2.8999999999999999e164Initial program 99.4%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around inf 60.4%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -1.55e+143) (not (<= x 1.9e+165))) (* -60.0 (/ x t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.55e+143) || !(x <= 1.9e+165)) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-1.55d+143)) .or. (.not. (x <= 1.9d+165))) then
tmp = (-60.0d0) * (x / t)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.55e+143) || !(x <= 1.9e+165)) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -1.55e+143) or not (x <= 1.9e+165): tmp = -60.0 * (x / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -1.55e+143) || !(x <= 1.9e+165)) tmp = Float64(-60.0 * Float64(x / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -1.55e+143) || ~((x <= 1.9e+165))) tmp = -60.0 * (x / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.55e+143], N[Not[LessEqual[x, 1.9e+165]], $MachinePrecision]], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+143} \lor \neg \left(x \leq 1.9 \cdot 10^{+165}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -1.54999999999999995e143 or 1.89999999999999995e165 < x Initial program 93.4%
associate-/l*99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in x around inf 93.2%
Taylor expanded in x around inf 69.6%
Taylor expanded in z around 0 43.9%
if -1.54999999999999995e143 < x < 1.89999999999999995e165Initial program 99.4%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around inf 60.4%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (+ (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (a * 120.0d0) + (60.0d0 * ((x - y) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
def code(x, y, z, t, a): return (a * 120.0) + (60.0 * ((x - y) / (z - t)))
function code(x, y, z, t, a) return Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = (a * 120.0) + (60.0 * ((x - y) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120 + 60 \cdot \frac{x - y}{z - t}
\end{array}
Initial program 98.0%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (* a 120.0))
double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = a * 120.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
def code(x, y, z, t, a): return a * 120.0
function code(x, y, z, t, a) return Float64(a * 120.0) end
function tmp = code(x, y, z, t, a) tmp = a * 120.0; end
code[x_, y_, z_, t_, a_] := N[(a * 120.0), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120
\end{array}
Initial program 98.0%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around inf 50.7%
Final simplification50.7%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
herbie shell --seed 2024144
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))