
(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 16 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 (fma 60.0 (/ (- x y) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return fma(60.0, ((x - y) / (z - t)), (a * 120.0));
}
function code(x, y, z, t, a) return fma(60.0, Float64(Float64(x - y) / Float64(z - t)), Float64(a * 120.0)) end
code[x_, y_, z_, t_, a_] := N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)
\end{array}
Initial program 99.1%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+153)
(* 60.0 (/ (- x y) (- z t)))
(if (<= t_1 -2e+87)
(+ (* a 120.0) (* 60.0 (/ x z)))
(if (<= t_1 -2e+74)
(* (- x y) (/ 60.0 (- z t)))
(if (<= t_1 5e+27) (* a 120.0) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+153) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= -2e+87) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else if (t_1 <= -2e+74) {
tmp = (x - y) * (60.0 / (z - t));
} else if (t_1 <= 5e+27) {
tmp = a * 120.0;
} 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 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+153)) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if (t_1 <= (-2d+87)) then
tmp = (a * 120.0d0) + (60.0d0 * (x / z))
else if (t_1 <= (-2d+74)) then
tmp = (x - y) * (60.0d0 / (z - t))
else if (t_1 <= 5d+27) then
tmp = a * 120.0d0
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 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+153) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= -2e+87) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else if (t_1 <= -2e+74) {
tmp = (x - y) * (60.0 / (z - t));
} else if (t_1 <= 5e+27) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+153: tmp = 60.0 * ((x - y) / (z - t)) elif t_1 <= -2e+87: tmp = (a * 120.0) + (60.0 * (x / z)) elif t_1 <= -2e+74: tmp = (x - y) * (60.0 / (z - t)) elif t_1 <= 5e+27: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+153) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (t_1 <= -2e+87) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z))); elseif (t_1 <= -2e+74) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); elseif (t_1 <= 5e+27) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+153) tmp = 60.0 * ((x - y) / (z - t)); elseif (t_1 <= -2e+87) tmp = (a * 120.0) + (60.0 * (x / z)); elseif (t_1 <= -2e+74) tmp = (x - y) * (60.0 / (z - t)); elseif (t_1 <= 5e+27) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+153], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+87], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+74], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+27], N[(a * 120.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+153}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+87}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+74}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+27}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1e153Initial program 97.2%
Taylor expanded in a around 0 86.6%
if -1e153 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999999e87Initial program 100.0%
Taylor expanded in x around inf 84.2%
Taylor expanded in z around inf 73.6%
if -1.9999999999999999e87 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999999e74Initial program 99.7%
Taylor expanded in a around 0 99.7%
associate-*r/99.7%
Simplified99.7%
*-commutative99.7%
associate-/l*100.0%
Applied egg-rr100.0%
if -1.9999999999999999e74 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.99999999999999979e27Initial program 99.9%
Taylor expanded in z around inf 78.6%
if 4.99999999999999979e27 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.0%
Taylor expanded in a around 0 78.0%
associate-*r/78.1%
Simplified78.1%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -5e+107)
(+ (* a 120.0) (/ (* 60.0 y) t))
(if (<= (* a 120.0) -2e+22)
(+ (* a 120.0) (/ (* 60.0 x) z))
(if (<= (* a 120.0) -20.0)
(+ (* a 120.0) (* -60.0 (/ x t)))
(if (<= (* a 120.0) 1e-68) (* 60.0 (/ (- x y) (- z t))) (* a 120.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e+107) {
tmp = (a * 120.0) + ((60.0 * y) / t);
} else if ((a * 120.0) <= -2e+22) {
tmp = (a * 120.0) + ((60.0 * x) / z);
} else if ((a * 120.0) <= -20.0) {
tmp = (a * 120.0) + (-60.0 * (x / t));
} else if ((a * 120.0) <= 1e-68) {
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 ((a * 120.0d0) <= (-5d+107)) then
tmp = (a * 120.0d0) + ((60.0d0 * y) / t)
else if ((a * 120.0d0) <= (-2d+22)) then
tmp = (a * 120.0d0) + ((60.0d0 * x) / z)
else if ((a * 120.0d0) <= (-20.0d0)) then
tmp = (a * 120.0d0) + ((-60.0d0) * (x / t))
else if ((a * 120.0d0) <= 1d-68) 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 ((a * 120.0) <= -5e+107) {
tmp = (a * 120.0) + ((60.0 * y) / t);
} else if ((a * 120.0) <= -2e+22) {
tmp = (a * 120.0) + ((60.0 * x) / z);
} else if ((a * 120.0) <= -20.0) {
tmp = (a * 120.0) + (-60.0 * (x / t));
} else if ((a * 120.0) <= 1e-68) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -5e+107: tmp = (a * 120.0) + ((60.0 * y) / t) elif (a * 120.0) <= -2e+22: tmp = (a * 120.0) + ((60.0 * x) / z) elif (a * 120.0) <= -20.0: tmp = (a * 120.0) + (-60.0 * (x / t)) elif (a * 120.0) <= 1e-68: 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(a * 120.0) <= -5e+107) tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * y) / t)); elseif (Float64(a * 120.0) <= -2e+22) tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * x) / z)); elseif (Float64(a * 120.0) <= -20.0) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(x / t))); elseif (Float64(a * 120.0) <= 1e-68) 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 ((a * 120.0) <= -5e+107) tmp = (a * 120.0) + ((60.0 * y) / t); elseif ((a * 120.0) <= -2e+22) tmp = (a * 120.0) + ((60.0 * x) / z); elseif ((a * 120.0) <= -20.0) tmp = (a * 120.0) + (-60.0 * (x / t)); elseif ((a * 120.0) <= 1e-68) tmp = 60.0 * ((x - y) / (z - t)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e+107], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], -2e+22], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], -20.0], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-68], 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}\;a \cdot 120 \leq -5 \cdot 10^{+107}:\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot y}{t}\\
\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{+22}:\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z}\\
\mathbf{elif}\;a \cdot 120 \leq -20:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-68}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.0000000000000002e107Initial program 99.9%
Taylor expanded in x around 0 93.0%
Taylor expanded in z around 0 85.8%
associate-*r/85.8%
*-commutative85.8%
Simplified85.8%
if -5.0000000000000002e107 < (*.f64 a #s(literal 120 binary64)) < -2e22Initial program 100.0%
Taylor expanded in x around inf 91.7%
Taylor expanded in z around inf 85.6%
associate-*r/85.7%
Applied egg-rr85.7%
if -2e22 < (*.f64 a #s(literal 120 binary64)) < -20Initial program 100.0%
Taylor expanded in x around inf 80.1%
Taylor expanded in z around 0 80.1%
if -20 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000007e-68Initial program 98.8%
Taylor expanded in a around 0 76.5%
if 1.00000000000000007e-68 < (*.f64 a #s(literal 120 binary64)) Initial program 98.8%
Taylor expanded in z around inf 75.7%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -4e+33)
(* a 120.0)
(if (<= (* a 120.0) 1e-68)
(* 60.0 (/ (- x y) (- z t)))
(if (<= (* a 120.0) 2e+91)
(+ (* a 120.0) (/ (* 60.0 x) z))
(if (<= (* a 120.0) 2e+219)
(+ (* a 120.0) (/ -60.0 (/ z y)))
(* a 120.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -4e+33) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-68) {
tmp = 60.0 * ((x - y) / (z - t));
} else if ((a * 120.0) <= 2e+91) {
tmp = (a * 120.0) + ((60.0 * x) / z);
} else if ((a * 120.0) <= 2e+219) {
tmp = (a * 120.0) + (-60.0 / (z / y));
} 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 ((a * 120.0d0) <= (-4d+33)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 1d-68) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if ((a * 120.0d0) <= 2d+91) then
tmp = (a * 120.0d0) + ((60.0d0 * x) / z)
else if ((a * 120.0d0) <= 2d+219) then
tmp = (a * 120.0d0) + ((-60.0d0) / (z / y))
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 ((a * 120.0) <= -4e+33) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-68) {
tmp = 60.0 * ((x - y) / (z - t));
} else if ((a * 120.0) <= 2e+91) {
tmp = (a * 120.0) + ((60.0 * x) / z);
} else if ((a * 120.0) <= 2e+219) {
tmp = (a * 120.0) + (-60.0 / (z / y));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -4e+33: tmp = a * 120.0 elif (a * 120.0) <= 1e-68: tmp = 60.0 * ((x - y) / (z - t)) elif (a * 120.0) <= 2e+91: tmp = (a * 120.0) + ((60.0 * x) / z) elif (a * 120.0) <= 2e+219: tmp = (a * 120.0) + (-60.0 / (z / y)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -4e+33) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 1e-68) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (Float64(a * 120.0) <= 2e+91) tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * x) / z)); elseif (Float64(a * 120.0) <= 2e+219) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(z / y))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -4e+33) tmp = a * 120.0; elseif ((a * 120.0) <= 1e-68) tmp = 60.0 * ((x - y) / (z - t)); elseif ((a * 120.0) <= 2e+91) tmp = (a * 120.0) + ((60.0 * x) / z); elseif ((a * 120.0) <= 2e+219) tmp = (a * 120.0) + (-60.0 / (z / y)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -4e+33], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-68], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e+91], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e+219], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+33}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-68}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+91}:\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z}\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+219}:\\
\;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -3.9999999999999998e33 or 1.99999999999999993e219 < (*.f64 a #s(literal 120 binary64)) Initial program 98.7%
Taylor expanded in z around inf 83.9%
if -3.9999999999999998e33 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000007e-68Initial program 98.9%
Taylor expanded in a around 0 74.6%
if 1.00000000000000007e-68 < (*.f64 a #s(literal 120 binary64)) < 2.00000000000000016e91Initial program 99.9%
Taylor expanded in x around inf 92.3%
Taylor expanded in z around inf 77.0%
associate-*r/77.1%
Applied egg-rr77.1%
if 2.00000000000000016e91 < (*.f64 a #s(literal 120 binary64)) < 1.99999999999999993e219Initial program 100.0%
Taylor expanded in x around 0 91.2%
Taylor expanded in z around inf 77.8%
*-commutative77.8%
associate-*l/77.8%
associate-*r/77.8%
*-commutative77.8%
associate-/r/77.7%
Simplified77.7%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -4e+33)
(* a 120.0)
(if (<= (* a 120.0) 1e-68)
(* 60.0 (/ (- x y) (- z t)))
(if (<= (* a 120.0) 2e+91)
(+ (* a 120.0) (* 60.0 (/ x z)))
(if (<= (* a 120.0) 2e+219)
(+ (* a 120.0) (/ -60.0 (/ z y)))
(* a 120.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -4e+33) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-68) {
tmp = 60.0 * ((x - y) / (z - t));
} else if ((a * 120.0) <= 2e+91) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else if ((a * 120.0) <= 2e+219) {
tmp = (a * 120.0) + (-60.0 / (z / y));
} 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 ((a * 120.0d0) <= (-4d+33)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 1d-68) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if ((a * 120.0d0) <= 2d+91) then
tmp = (a * 120.0d0) + (60.0d0 * (x / z))
else if ((a * 120.0d0) <= 2d+219) then
tmp = (a * 120.0d0) + ((-60.0d0) / (z / y))
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 ((a * 120.0) <= -4e+33) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-68) {
tmp = 60.0 * ((x - y) / (z - t));
} else if ((a * 120.0) <= 2e+91) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else if ((a * 120.0) <= 2e+219) {
tmp = (a * 120.0) + (-60.0 / (z / y));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -4e+33: tmp = a * 120.0 elif (a * 120.0) <= 1e-68: tmp = 60.0 * ((x - y) / (z - t)) elif (a * 120.0) <= 2e+91: tmp = (a * 120.0) + (60.0 * (x / z)) elif (a * 120.0) <= 2e+219: tmp = (a * 120.0) + (-60.0 / (z / y)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -4e+33) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 1e-68) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (Float64(a * 120.0) <= 2e+91) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z))); elseif (Float64(a * 120.0) <= 2e+219) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(z / y))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -4e+33) tmp = a * 120.0; elseif ((a * 120.0) <= 1e-68) tmp = 60.0 * ((x - y) / (z - t)); elseif ((a * 120.0) <= 2e+91) tmp = (a * 120.0) + (60.0 * (x / z)); elseif ((a * 120.0) <= 2e+219) tmp = (a * 120.0) + (-60.0 / (z / y)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -4e+33], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-68], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e+91], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e+219], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+33}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-68}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+91}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+219}:\\
\;\;\;\;a \cdot 120 + \frac{-60}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -3.9999999999999998e33 or 1.99999999999999993e219 < (*.f64 a #s(literal 120 binary64)) Initial program 98.7%
Taylor expanded in z around inf 83.9%
if -3.9999999999999998e33 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000007e-68Initial program 98.9%
Taylor expanded in a around 0 74.6%
if 1.00000000000000007e-68 < (*.f64 a #s(literal 120 binary64)) < 2.00000000000000016e91Initial program 99.9%
Taylor expanded in x around inf 92.3%
Taylor expanded in z around inf 77.0%
if 2.00000000000000016e91 < (*.f64 a #s(literal 120 binary64)) < 1.99999999999999993e219Initial program 100.0%
Taylor expanded in x around 0 91.2%
Taylor expanded in z around inf 77.8%
*-commutative77.8%
associate-*l/77.8%
associate-*r/77.8%
*-commutative77.8%
associate-/r/77.7%
Simplified77.7%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.2e+217)
(* -60.0 (/ y (- z t)))
(if (<= y 2.5e-202)
(* a 120.0)
(if (<= y 2.15e-180)
(/ 60.0 (/ (- z t) x))
(if (<= y 6e+172) (* a 120.0) (/ (* y -60.0) (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.2e+217) {
tmp = -60.0 * (y / (z - t));
} else if (y <= 2.5e-202) {
tmp = a * 120.0;
} else if (y <= 2.15e-180) {
tmp = 60.0 / ((z - t) / x);
} else if (y <= 6e+172) {
tmp = a * 120.0;
} else {
tmp = (y * -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 <= (-1.2d+217)) then
tmp = (-60.0d0) * (y / (z - t))
else if (y <= 2.5d-202) then
tmp = a * 120.0d0
else if (y <= 2.15d-180) then
tmp = 60.0d0 / ((z - t) / x)
else if (y <= 6d+172) then
tmp = a * 120.0d0
else
tmp = (y * (-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 <= -1.2e+217) {
tmp = -60.0 * (y / (z - t));
} else if (y <= 2.5e-202) {
tmp = a * 120.0;
} else if (y <= 2.15e-180) {
tmp = 60.0 / ((z - t) / x);
} else if (y <= 6e+172) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / (z - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.2e+217: tmp = -60.0 * (y / (z - t)) elif y <= 2.5e-202: tmp = a * 120.0 elif y <= 2.15e-180: tmp = 60.0 / ((z - t) / x) elif y <= 6e+172: tmp = a * 120.0 else: tmp = (y * -60.0) / (z - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.2e+217) tmp = Float64(-60.0 * Float64(y / Float64(z - t))); elseif (y <= 2.5e-202) tmp = Float64(a * 120.0); elseif (y <= 2.15e-180) tmp = Float64(60.0 / Float64(Float64(z - t) / x)); elseif (y <= 6e+172) tmp = Float64(a * 120.0); else tmp = Float64(Float64(y * -60.0) / Float64(z - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.2e+217) tmp = -60.0 * (y / (z - t)); elseif (y <= 2.5e-202) tmp = a * 120.0; elseif (y <= 2.15e-180) tmp = 60.0 / ((z - t) / x); elseif (y <= 6e+172) tmp = a * 120.0; else tmp = (y * -60.0) / (z - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.2e+217], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-202], N[(a * 120.0), $MachinePrecision], If[LessEqual[y, 2.15e-180], N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+172], N[(a * 120.0), $MachinePrecision], N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+217}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-202}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-180}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x}}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+172}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z - t}\\
\end{array}
\end{array}
if y < -1.1999999999999999e217Initial program 92.8%
Taylor expanded in y around inf 60.3%
if -1.1999999999999999e217 < y < 2.49999999999999986e-202 or 2.1499999999999998e-180 < y < 5.9999999999999998e172Initial program 99.4%
Taylor expanded in z around inf 66.2%
if 2.49999999999999986e-202 < y < 2.1499999999999998e-180Initial program 99.8%
Taylor expanded in x around inf 80.5%
clear-num80.5%
un-div-inv80.6%
Applied egg-rr80.6%
if 5.9999999999999998e172 < y Initial program 99.8%
Taylor expanded in a around 0 79.6%
associate-*r/79.7%
Simplified79.7%
Taylor expanded in x around 0 76.4%
Final simplification67.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ y (- z t)))))
(if (<= y -9e+216)
t_1
(if (<= y 1.32e-201)
(* a 120.0)
(if (<= y 2.15e-180)
(/ 60.0 (/ (- z t) x))
(if (<= y 1.45e+172) (* a 120.0) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -9e+216) {
tmp = t_1;
} else if (y <= 1.32e-201) {
tmp = a * 120.0;
} else if (y <= 2.15e-180) {
tmp = 60.0 / ((z - t) / x);
} else if (y <= 1.45e+172) {
tmp = a * 120.0;
} 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 = (-60.0d0) * (y / (z - t))
if (y <= (-9d+216)) then
tmp = t_1
else if (y <= 1.32d-201) then
tmp = a * 120.0d0
else if (y <= 2.15d-180) then
tmp = 60.0d0 / ((z - t) / x)
else if (y <= 1.45d+172) then
tmp = a * 120.0d0
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 = -60.0 * (y / (z - t));
double tmp;
if (y <= -9e+216) {
tmp = t_1;
} else if (y <= 1.32e-201) {
tmp = a * 120.0;
} else if (y <= 2.15e-180) {
tmp = 60.0 / ((z - t) / x);
} else if (y <= 1.45e+172) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) tmp = 0 if y <= -9e+216: tmp = t_1 elif y <= 1.32e-201: tmp = a * 120.0 elif y <= 2.15e-180: tmp = 60.0 / ((z - t) / x) elif y <= 1.45e+172: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -9e+216) tmp = t_1; elseif (y <= 1.32e-201) tmp = Float64(a * 120.0); elseif (y <= 2.15e-180) tmp = Float64(60.0 / Float64(Float64(z - t) / x)); elseif (y <= 1.45e+172) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (y / (z - t)); tmp = 0.0; if (y <= -9e+216) tmp = t_1; elseif (y <= 1.32e-201) tmp = a * 120.0; elseif (y <= 2.15e-180) tmp = 60.0 / ((z - t) / x); elseif (y <= 1.45e+172) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+216], t$95$1, If[LessEqual[y, 1.32e-201], N[(a * 120.0), $MachinePrecision], If[LessEqual[y, 2.15e-180], N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+172], N[(a * 120.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+216}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{-201}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-180}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x}}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+172}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.0000000000000005e216 or 1.45e172 < y Initial program 97.8%
Taylor expanded in y around inf 71.6%
if -9.0000000000000005e216 < y < 1.31999999999999996e-201 or 2.1499999999999998e-180 < y < 1.45e172Initial program 99.4%
Taylor expanded in z around inf 66.2%
if 1.31999999999999996e-201 < y < 2.1499999999999998e-180Initial program 99.8%
Taylor expanded in x around inf 80.5%
clear-num80.5%
un-div-inv80.6%
Applied egg-rr80.6%
Final simplification67.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ y (- z t)))))
(if (<= y -9e+216)
t_1
(if (<= y 3.75e-202)
(* a 120.0)
(if (<= y 2.15e-180)
(* 60.0 (/ x (- z t)))
(if (<= y 2.9e+173) (* a 120.0) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -9e+216) {
tmp = t_1;
} else if (y <= 3.75e-202) {
tmp = a * 120.0;
} else if (y <= 2.15e-180) {
tmp = 60.0 * (x / (z - t));
} else if (y <= 2.9e+173) {
tmp = a * 120.0;
} 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 = (-60.0d0) * (y / (z - t))
if (y <= (-9d+216)) then
tmp = t_1
else if (y <= 3.75d-202) then
tmp = a * 120.0d0
else if (y <= 2.15d-180) then
tmp = 60.0d0 * (x / (z - t))
else if (y <= 2.9d+173) then
tmp = a * 120.0d0
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 = -60.0 * (y / (z - t));
double tmp;
if (y <= -9e+216) {
tmp = t_1;
} else if (y <= 3.75e-202) {
tmp = a * 120.0;
} else if (y <= 2.15e-180) {
tmp = 60.0 * (x / (z - t));
} else if (y <= 2.9e+173) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) tmp = 0 if y <= -9e+216: tmp = t_1 elif y <= 3.75e-202: tmp = a * 120.0 elif y <= 2.15e-180: tmp = 60.0 * (x / (z - t)) elif y <= 2.9e+173: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -9e+216) tmp = t_1; elseif (y <= 3.75e-202) tmp = Float64(a * 120.0); elseif (y <= 2.15e-180) tmp = Float64(60.0 * Float64(x / Float64(z - t))); elseif (y <= 2.9e+173) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (y / (z - t)); tmp = 0.0; if (y <= -9e+216) tmp = t_1; elseif (y <= 3.75e-202) tmp = a * 120.0; elseif (y <= 2.15e-180) tmp = 60.0 * (x / (z - t)); elseif (y <= 2.9e+173) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+216], t$95$1, If[LessEqual[y, 3.75e-202], N[(a * 120.0), $MachinePrecision], If[LessEqual[y, 2.15e-180], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+173], N[(a * 120.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+216}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.75 \cdot 10^{-202}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-180}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+173}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.0000000000000005e216 or 2.90000000000000007e173 < y Initial program 97.8%
Taylor expanded in y around inf 71.6%
if -9.0000000000000005e216 < y < 3.75000000000000002e-202 or 2.1499999999999998e-180 < y < 2.90000000000000007e173Initial program 99.4%
Taylor expanded in z around inf 66.2%
if 3.75000000000000002e-202 < y < 2.1499999999999998e-180Initial program 99.8%
Taylor expanded in x around inf 80.5%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -20.0) (not (<= (* a 120.0) 5e-125))) (+ (* a 120.0) (/ (* y -60.0) (- z t))) (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -20.0) || !((a * 120.0) <= 5e-125)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (x - y) * (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 (((a * 120.0d0) <= (-20.0d0)) .or. (.not. ((a * 120.0d0) <= 5d-125))) then
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
else
tmp = (x - y) * (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 (((a * 120.0) <= -20.0) || !((a * 120.0) <= 5e-125)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -20.0) or not ((a * 120.0) <= 5e-125): tmp = (a * 120.0) + ((y * -60.0) / (z - t)) else: tmp = (x - y) * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -20.0) || !(Float64(a * 120.0) <= 5e-125)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); else tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -20.0) || ~(((a * 120.0) <= 5e-125))) tmp = (a * 120.0) + ((y * -60.0) / (z - t)); else tmp = (x - y) * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -20.0], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-125]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -20 \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-125}\right):\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -20 or 4.99999999999999967e-125 < (*.f64 a #s(literal 120 binary64)) Initial program 99.4%
Taylor expanded in x around 0 87.3%
if -20 < (*.f64 a #s(literal 120 binary64)) < 4.99999999999999967e-125Initial program 98.6%
Taylor expanded in a around 0 79.0%
associate-*r/77.9%
Simplified77.9%
*-commutative98.6%
associate-/l*99.7%
Applied egg-rr79.0%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -4e+33) (not (<= (* a 120.0) 1e-68))) (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -4e+33) || !((a * 120.0) <= 1e-68)) {
tmp = a * 120.0;
} 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) :: tmp
if (((a * 120.0d0) <= (-4d+33)) .or. (.not. ((a * 120.0d0) <= 1d-68))) then
tmp = a * 120.0d0
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 tmp;
if (((a * 120.0) <= -4e+33) || !((a * 120.0) <= 1e-68)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -4e+33) or not ((a * 120.0) <= 1e-68): tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -4e+33) || !(Float64(a * 120.0) <= 1e-68)) tmp = Float64(a * 120.0); 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) tmp = 0.0; if (((a * 120.0) <= -4e+33) || ~(((a * 120.0) <= 1e-68))) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -4e+33], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-68]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+33} \lor \neg \left(a \cdot 120 \leq 10^{-68}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -3.9999999999999998e33 or 1.00000000000000007e-68 < (*.f64 a #s(literal 120 binary64)) Initial program 99.3%
Taylor expanded in z around inf 78.0%
if -3.9999999999999998e33 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000007e-68Initial program 98.9%
Taylor expanded in a around 0 74.6%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -7e+81) (not (<= y 8e+95))) (+ (* a 120.0) (/ (* y -60.0) (- z t))) (+ (* a 120.0) (/ (* 60.0 x) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -7e+81) || !(y <= 8e+95)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (a * 120.0) + ((60.0 * x) / (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 <= (-7d+81)) .or. (.not. (y <= 8d+95))) then
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
else
tmp = (a * 120.0d0) + ((60.0d0 * x) / (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 <= -7e+81) || !(y <= 8e+95)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (a * 120.0) + ((60.0 * x) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -7e+81) or not (y <= 8e+95): tmp = (a * 120.0) + ((y * -60.0) / (z - t)) else: tmp = (a * 120.0) + ((60.0 * x) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -7e+81) || !(y <= 8e+95)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * x) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -7e+81) || ~((y <= 8e+95))) tmp = (a * 120.0) + ((y * -60.0) / (z - t)); else tmp = (a * 120.0) + ((60.0 * x) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -7e+81], N[Not[LessEqual[y, 8e+95]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+81} \lor \neg \left(y \leq 8 \cdot 10^{+95}\right):\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\
\end{array}
\end{array}
if y < -7.0000000000000001e81 or 8.00000000000000016e95 < y Initial program 98.7%
Taylor expanded in x around 0 91.2%
if -7.0000000000000001e81 < y < 8.00000000000000016e95Initial program 99.3%
Taylor expanded in x around inf 94.8%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.55e+219) (not (<= y 1.6e+172))) (* -60.0 (/ y (- z t))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.55e+219) || !(y <= 1.6e+172)) {
tmp = -60.0 * (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 ((y <= (-2.55d+219)) .or. (.not. (y <= 1.6d+172))) then
tmp = (-60.0d0) * (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 ((y <= -2.55e+219) || !(y <= 1.6e+172)) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.55e+219) or not (y <= 1.6e+172): tmp = -60.0 * (y / (z - t)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.55e+219) || !(y <= 1.6e+172)) tmp = Float64(-60.0 * Float64(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 ((y <= -2.55e+219) || ~((y <= 1.6e+172))) tmp = -60.0 * (y / (z - t)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.55e+219], N[Not[LessEqual[y, 1.6e+172]], $MachinePrecision]], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{+219} \lor \neg \left(y \leq 1.6 \cdot 10^{+172}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -2.54999999999999997e219 or 1.59999999999999993e172 < y Initial program 97.8%
Taylor expanded in y around inf 71.6%
if -2.54999999999999997e219 < y < 1.59999999999999993e172Initial program 99.4%
Taylor expanded in z around inf 64.1%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.8e-91) (not (<= a 1.6e-127))) (* a 120.0) (* -60.0 (/ y z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.8e-91) || !(a <= 1.6e-127)) {
tmp = a * 120.0;
} else {
tmp = -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 <= (-2.8d-91)) .or. (.not. (a <= 1.6d-127))) then
tmp = a * 120.0d0
else
tmp = (-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 <= -2.8e-91) || !(a <= 1.6e-127)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.8e-91) or not (a <= 1.6e-127): tmp = a * 120.0 else: tmp = -60.0 * (y / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.8e-91) || !(a <= 1.6e-127)) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.8e-91) || ~((a <= 1.6e-127))) tmp = a * 120.0; else tmp = -60.0 * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.8e-91], N[Not[LessEqual[a, 1.6e-127]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-91} \lor \neg \left(a \leq 1.6 \cdot 10^{-127}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if a < -2.8e-91 or 1.60000000000000009e-127 < a Initial program 99.4%
Taylor expanded in z around inf 69.8%
if -2.8e-91 < a < 1.60000000000000009e-127Initial program 98.3%
Taylor expanded in a around 0 83.7%
associate-*r/82.2%
Simplified82.2%
Taylor expanded in z around inf 53.1%
Taylor expanded in x around 0 34.6%
Final simplification60.3%
(FPCore (x y z t a) :precision binary64 (+ (* a 120.0) (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + ((x - y) * (60.0 / (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) + ((x - y) * (60.0d0 / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + ((x - y) * (60.0 / (z - t)));
}
def code(x, y, z, t, a): return (a * 120.0) + ((x - y) * (60.0 / (z - t)))
function code(x, y, z, t, a) return Float64(Float64(a * 120.0) + Float64(Float64(x - y) * Float64(60.0 / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = (a * 120.0) + ((x - y) * (60.0 / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120 + \left(x - y\right) \cdot \frac{60}{z - t}
\end{array}
Initial program 99.1%
*-commutative99.1%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (<= y 3.5e+173) (* a 120.0) (* 60.0 (/ y t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.5e+173) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / 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.5d+173) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (y / 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.5e+173) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 3.5e+173: tmp = a * 120.0 else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 3.5e+173) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 3.5e+173) tmp = a * 120.0; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3.5e+173], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{+173}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < 3.4999999999999999e173Initial program 99.0%
Taylor expanded in z around inf 61.5%
if 3.4999999999999999e173 < y Initial program 99.8%
Taylor expanded in a around 0 79.6%
associate-*r/79.7%
Simplified79.7%
Taylor expanded in z around 0 56.9%
Taylor expanded in x around 0 53.5%
Final simplification60.4%
(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 99.1%
Taylor expanded in z around inf 56.1%
Final simplification56.1%
(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 2024097
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))