
(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 a 120.0 (* (/ 60.0 (- z t)) (- x y))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((60.0 / (z - t)) * (x - y)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)
\end{array}
Initial program 99.7%
+-commutative99.7%
fma-def99.8%
associate-*l/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -0.05)
(- (* a 120.0) (* 60.0 (/ x t)))
(if (<= (* a 120.0) 200000000.0)
(* (/ 60.0 (- z t)) (- x y))
(if (<= (* a 120.0) 1e+73)
(- (* a 120.0) (* x (/ -60.0 z)))
(+ (* a 120.0) (* y (/ 60.0 t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -0.05) {
tmp = (a * 120.0) - (60.0 * (x / t));
} else if ((a * 120.0) <= 200000000.0) {
tmp = (60.0 / (z - t)) * (x - y);
} else if ((a * 120.0) <= 1e+73) {
tmp = (a * 120.0) - (x * (-60.0 / z));
} else {
tmp = (a * 120.0) + (y * (60.0 / 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) <= (-0.05d0)) then
tmp = (a * 120.0d0) - (60.0d0 * (x / t))
else if ((a * 120.0d0) <= 200000000.0d0) then
tmp = (60.0d0 / (z - t)) * (x - y)
else if ((a * 120.0d0) <= 1d+73) then
tmp = (a * 120.0d0) - (x * ((-60.0d0) / z))
else
tmp = (a * 120.0d0) + (y * (60.0d0 / 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) <= -0.05) {
tmp = (a * 120.0) - (60.0 * (x / t));
} else if ((a * 120.0) <= 200000000.0) {
tmp = (60.0 / (z - t)) * (x - y);
} else if ((a * 120.0) <= 1e+73) {
tmp = (a * 120.0) - (x * (-60.0 / z));
} else {
tmp = (a * 120.0) + (y * (60.0 / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -0.05: tmp = (a * 120.0) - (60.0 * (x / t)) elif (a * 120.0) <= 200000000.0: tmp = (60.0 / (z - t)) * (x - y) elif (a * 120.0) <= 1e+73: tmp = (a * 120.0) - (x * (-60.0 / z)) else: tmp = (a * 120.0) + (y * (60.0 / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -0.05) tmp = Float64(Float64(a * 120.0) - Float64(60.0 * Float64(x / t))); elseif (Float64(a * 120.0) <= 200000000.0) tmp = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y)); elseif (Float64(a * 120.0) <= 1e+73) tmp = Float64(Float64(a * 120.0) - Float64(x * Float64(-60.0 / z))); else tmp = Float64(Float64(a * 120.0) + Float64(y * Float64(60.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -0.05) tmp = (a * 120.0) - (60.0 * (x / t)); elseif ((a * 120.0) <= 200000000.0) tmp = (60.0 / (z - t)) * (x - y); elseif ((a * 120.0) <= 1e+73) tmp = (a * 120.0) - (x * (-60.0 / z)); else tmp = (a * 120.0) + (y * (60.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -0.05], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 200000000.0], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e+73], N[(N[(a * 120.0), $MachinePrecision] - N[(x * N[(-60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -0.05:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t}\\
\mathbf{elif}\;a \cdot 120 \leq 200000000:\\
\;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\
\mathbf{elif}\;a \cdot 120 \leq 10^{+73}:\\
\;\;\;\;a \cdot 120 - x \cdot \frac{-60}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{60}{t}\\
\end{array}
\end{array}
if (*.f64 a 120) < -0.050000000000000003Initial program 99.9%
*-commutative99.9%
associate-/l*99.9%
frac-2neg99.9%
distribute-frac-neg99.9%
div-inv99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y around 0 81.2%
if -0.050000000000000003 < (*.f64 a 120) < 2e8Initial program 99.6%
*-commutative99.6%
associate-/l*99.6%
frac-2neg99.6%
distribute-frac-neg99.6%
div-inv99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
+-commutative99.6%
unsub-neg99.6%
div-inv99.5%
*-commutative99.5%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 76.2%
associate-*r/76.2%
associate-/l*76.3%
associate-/r/76.3%
Simplified76.3%
if 2e8 < (*.f64 a 120) < 9.99999999999999983e72Initial program 99.6%
*-commutative99.6%
associate-/l*99.8%
frac-2neg99.8%
distribute-frac-neg99.8%
div-inv99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
+-commutative99.8%
unsub-neg99.8%
div-inv100.0%
*-commutative100.0%
associate-/r*99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 93.3%
Taylor expanded in x around inf 93.6%
associate-*r/93.3%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if 9.99999999999999983e72 < (*.f64 a 120) Initial program 99.9%
Taylor expanded in x around 0 95.4%
associate-*r/95.4%
Simplified95.4%
Taylor expanded in z around 0 84.1%
associate-*r/84.2%
metadata-eval84.2%
distribute-lft-neg-in84.2%
*-commutative84.2%
distribute-neg-frac84.2%
associate-*r/84.2%
distribute-rgt-neg-in84.2%
distribute-neg-frac84.2%
metadata-eval84.2%
Simplified84.2%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -0.05)
(- (* a 120.0) (* 60.0 (/ x t)))
(if (<= (* a 120.0) 200000000.0)
(/ 60.0 (/ (- z t) (- x y)))
(if (<= (* a 120.0) 1e+73)
(- (* a 120.0) (* x (/ -60.0 z)))
(+ (* a 120.0) (* y (/ 60.0 t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -0.05) {
tmp = (a * 120.0) - (60.0 * (x / t));
} else if ((a * 120.0) <= 200000000.0) {
tmp = 60.0 / ((z - t) / (x - y));
} else if ((a * 120.0) <= 1e+73) {
tmp = (a * 120.0) - (x * (-60.0 / z));
} else {
tmp = (a * 120.0) + (y * (60.0 / 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) <= (-0.05d0)) then
tmp = (a * 120.0d0) - (60.0d0 * (x / t))
else if ((a * 120.0d0) <= 200000000.0d0) then
tmp = 60.0d0 / ((z - t) / (x - y))
else if ((a * 120.0d0) <= 1d+73) then
tmp = (a * 120.0d0) - (x * ((-60.0d0) / z))
else
tmp = (a * 120.0d0) + (y * (60.0d0 / 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) <= -0.05) {
tmp = (a * 120.0) - (60.0 * (x / t));
} else if ((a * 120.0) <= 200000000.0) {
tmp = 60.0 / ((z - t) / (x - y));
} else if ((a * 120.0) <= 1e+73) {
tmp = (a * 120.0) - (x * (-60.0 / z));
} else {
tmp = (a * 120.0) + (y * (60.0 / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -0.05: tmp = (a * 120.0) - (60.0 * (x / t)) elif (a * 120.0) <= 200000000.0: tmp = 60.0 / ((z - t) / (x - y)) elif (a * 120.0) <= 1e+73: tmp = (a * 120.0) - (x * (-60.0 / z)) else: tmp = (a * 120.0) + (y * (60.0 / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -0.05) tmp = Float64(Float64(a * 120.0) - Float64(60.0 * Float64(x / t))); elseif (Float64(a * 120.0) <= 200000000.0) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); elseif (Float64(a * 120.0) <= 1e+73) tmp = Float64(Float64(a * 120.0) - Float64(x * Float64(-60.0 / z))); else tmp = Float64(Float64(a * 120.0) + Float64(y * Float64(60.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -0.05) tmp = (a * 120.0) - (60.0 * (x / t)); elseif ((a * 120.0) <= 200000000.0) tmp = 60.0 / ((z - t) / (x - y)); elseif ((a * 120.0) <= 1e+73) tmp = (a * 120.0) - (x * (-60.0 / z)); else tmp = (a * 120.0) + (y * (60.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -0.05], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 200000000.0], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e+73], N[(N[(a * 120.0), $MachinePrecision] - N[(x * N[(-60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -0.05:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t}\\
\mathbf{elif}\;a \cdot 120 \leq 200000000:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{elif}\;a \cdot 120 \leq 10^{+73}:\\
\;\;\;\;a \cdot 120 - x \cdot \frac{-60}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{60}{t}\\
\end{array}
\end{array}
if (*.f64 a 120) < -0.050000000000000003Initial program 99.9%
*-commutative99.9%
associate-/l*99.9%
frac-2neg99.9%
distribute-frac-neg99.9%
div-inv99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y around 0 81.2%
if -0.050000000000000003 < (*.f64 a 120) < 2e8Initial program 99.6%
+-commutative99.6%
fma-def99.6%
associate-*l/99.7%
Simplified99.7%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 76.2%
clear-num76.1%
un-div-inv76.3%
Applied egg-rr76.3%
if 2e8 < (*.f64 a 120) < 9.99999999999999983e72Initial program 99.6%
*-commutative99.6%
associate-/l*99.8%
frac-2neg99.8%
distribute-frac-neg99.8%
div-inv99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
+-commutative99.8%
unsub-neg99.8%
div-inv100.0%
*-commutative100.0%
associate-/r*99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 93.3%
Taylor expanded in x around inf 93.6%
associate-*r/93.3%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if 9.99999999999999983e72 < (*.f64 a 120) Initial program 99.9%
Taylor expanded in x around 0 95.4%
associate-*r/95.4%
Simplified95.4%
Taylor expanded in z around 0 84.1%
associate-*r/84.2%
metadata-eval84.2%
distribute-lft-neg-in84.2%
*-commutative84.2%
distribute-neg-frac84.2%
associate-*r/84.2%
distribute-rgt-neg-in84.2%
distribute-neg-frac84.2%
metadata-eval84.2%
Simplified84.2%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ (- x y) t))) (t_2 (* 60.0 (/ (- x y) z))))
(if (<= a -8.4e-10)
(* a 120.0)
(if (<= a -1.85e-271)
t_2
(if (<= a 3.8e-205)
t_1
(if (<= a 6e-168)
t_2
(if (<= a 4.2e-55) t_1 (if (<= a 900.0) t_2 (* a 120.0)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * ((x - y) / t);
double t_2 = 60.0 * ((x - y) / z);
double tmp;
if (a <= -8.4e-10) {
tmp = a * 120.0;
} else if (a <= -1.85e-271) {
tmp = t_2;
} else if (a <= 3.8e-205) {
tmp = t_1;
} else if (a <= 6e-168) {
tmp = t_2;
} else if (a <= 4.2e-55) {
tmp = t_1;
} else if (a <= 900.0) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-60.0d0) * ((x - y) / t)
t_2 = 60.0d0 * ((x - y) / z)
if (a <= (-8.4d-10)) then
tmp = a * 120.0d0
else if (a <= (-1.85d-271)) then
tmp = t_2
else if (a <= 3.8d-205) then
tmp = t_1
else if (a <= 6d-168) then
tmp = t_2
else if (a <= 4.2d-55) then
tmp = t_1
else if (a <= 900.0d0) then
tmp = t_2
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 t_1 = -60.0 * ((x - y) / t);
double t_2 = 60.0 * ((x - y) / z);
double tmp;
if (a <= -8.4e-10) {
tmp = a * 120.0;
} else if (a <= -1.85e-271) {
tmp = t_2;
} else if (a <= 3.8e-205) {
tmp = t_1;
} else if (a <= 6e-168) {
tmp = t_2;
} else if (a <= 4.2e-55) {
tmp = t_1;
} else if (a <= 900.0) {
tmp = t_2;
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * ((x - y) / t) t_2 = 60.0 * ((x - y) / z) tmp = 0 if a <= -8.4e-10: tmp = a * 120.0 elif a <= -1.85e-271: tmp = t_2 elif a <= 3.8e-205: tmp = t_1 elif a <= 6e-168: tmp = t_2 elif a <= 4.2e-55: tmp = t_1 elif a <= 900.0: tmp = t_2 else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(Float64(x - y) / t)) t_2 = Float64(60.0 * Float64(Float64(x - y) / z)) tmp = 0.0 if (a <= -8.4e-10) tmp = Float64(a * 120.0); elseif (a <= -1.85e-271) tmp = t_2; elseif (a <= 3.8e-205) tmp = t_1; elseif (a <= 6e-168) tmp = t_2; elseif (a <= 4.2e-55) tmp = t_1; elseif (a <= 900.0) tmp = t_2; else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * ((x - y) / t); t_2 = 60.0 * ((x - y) / z); tmp = 0.0; if (a <= -8.4e-10) tmp = a * 120.0; elseif (a <= -1.85e-271) tmp = t_2; elseif (a <= 3.8e-205) tmp = t_1; elseif (a <= 6e-168) tmp = t_2; elseif (a <= 4.2e-55) tmp = t_1; elseif (a <= 900.0) tmp = t_2; else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.4e-10], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -1.85e-271], t$95$2, If[LessEqual[a, 3.8e-205], t$95$1, If[LessEqual[a, 6e-168], t$95$2, If[LessEqual[a, 4.2e-55], t$95$1, If[LessEqual[a, 900.0], t$95$2, N[(a * 120.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{x - y}{t}\\
t_2 := 60 \cdot \frac{x - y}{z}\\
\mathbf{if}\;a \leq -8.4 \cdot 10^{-10}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -1.85 \cdot 10^{-271}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-168}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 900:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -8.3999999999999999e-10 or 900 < a Initial program 99.9%
Taylor expanded in z around inf 79.5%
if -8.3999999999999999e-10 < a < -1.85000000000000011e-271 or 3.79999999999999992e-205 < a < 5.99999999999999983e-168 or 4.2000000000000003e-55 < a < 900Initial program 99.6%
+-commutative99.6%
fma-def99.6%
associate-*l/99.6%
Simplified99.6%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 78.5%
Taylor expanded in z around inf 56.3%
if -1.85000000000000011e-271 < a < 3.79999999999999992e-205 or 5.99999999999999983e-168 < a < 4.2000000000000003e-55Initial program 99.6%
+-commutative99.6%
fma-def99.7%
associate-*l/99.8%
Simplified99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 72.5%
Taylor expanded in z around 0 50.0%
Final simplification66.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* -60.0 (/ (- x y) t)))))
(if (<= t -3.85e+62)
t_1
(if (<= t -3.7e-136)
(/ 60.0 (/ (- z t) (- x y)))
(if (<= t 1.15e-225)
(- (* a 120.0) (* x (/ -60.0 z)))
(if (<= t 4.2e-48) (- (* 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) + (-60.0 * ((x - y) / t));
double tmp;
if (t <= -3.85e+62) {
tmp = t_1;
} else if (t <= -3.7e-136) {
tmp = 60.0 / ((z - t) / (x - y));
} else if (t <= 1.15e-225) {
tmp = (a * 120.0) - (x * (-60.0 / z));
} else if (t <= 4.2e-48) {
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) + ((-60.0d0) * ((x - y) / t))
if (t <= (-3.85d+62)) then
tmp = t_1
else if (t <= (-3.7d-136)) then
tmp = 60.0d0 / ((z - t) / (x - y))
else if (t <= 1.15d-225) then
tmp = (a * 120.0d0) - (x * ((-60.0d0) / z))
else if (t <= 4.2d-48) 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) + (-60.0 * ((x - y) / t));
double tmp;
if (t <= -3.85e+62) {
tmp = t_1;
} else if (t <= -3.7e-136) {
tmp = 60.0 / ((z - t) / (x - y));
} else if (t <= 1.15e-225) {
tmp = (a * 120.0) - (x * (-60.0 / z));
} else if (t <= 4.2e-48) {
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) + (-60.0 * ((x - y) / t)) tmp = 0 if t <= -3.85e+62: tmp = t_1 elif t <= -3.7e-136: tmp = 60.0 / ((z - t) / (x - y)) elif t <= 1.15e-225: tmp = (a * 120.0) - (x * (-60.0 / z)) elif t <= 4.2e-48: 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(-60.0 * Float64(Float64(x - y) / t))) tmp = 0.0 if (t <= -3.85e+62) tmp = t_1; elseif (t <= -3.7e-136) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); elseif (t <= 1.15e-225) tmp = Float64(Float64(a * 120.0) - Float64(x * Float64(-60.0 / z))); elseif (t <= 4.2e-48) tmp = Float64(Float64(a * 120.0) - Float64(Float64(60.0 * y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (-60.0 * ((x - y) / t)); tmp = 0.0; if (t <= -3.85e+62) tmp = t_1; elseif (t <= -3.7e-136) tmp = 60.0 / ((z - t) / (x - y)); elseif (t <= 1.15e-225) tmp = (a * 120.0) - (x * (-60.0 / z)); elseif (t <= 4.2e-48) 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[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.85e+62], t$95$1, If[LessEqual[t, -3.7e-136], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-225], N[(N[(a * 120.0), $MachinePrecision] - N[(x * N[(-60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-48], N[(N[(a * 120.0), $MachinePrecision] - N[(N[(60.0 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{if}\;t \leq -3.85 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.7 \cdot 10^{-136}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-225}:\\
\;\;\;\;a \cdot 120 - x \cdot \frac{-60}{z}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-48}:\\
\;\;\;\;a \cdot 120 - \frac{60 \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.8500000000000001e62 or 4.19999999999999977e-48 < t Initial program 99.8%
Taylor expanded in z around 0 88.2%
if -3.8500000000000001e62 < t < -3.7e-136Initial program 99.5%
+-commutative99.5%
fma-def99.5%
associate-*l/99.7%
Simplified99.7%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 73.7%
clear-num73.7%
un-div-inv73.9%
Applied egg-rr73.9%
if -3.7e-136 < t < 1.1499999999999999e-225Initial program 99.7%
*-commutative99.7%
associate-/l*99.8%
frac-2neg99.8%
distribute-frac-neg99.8%
div-inv99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
+-commutative99.8%
unsub-neg99.8%
div-inv99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 92.6%
Taylor expanded in x around inf 76.6%
associate-*r/76.6%
associate-*l/76.6%
*-commutative76.6%
Simplified76.6%
if 1.1499999999999999e-225 < t < 4.19999999999999977e-48Initial program 99.8%
*-commutative99.8%
associate-/l*99.7%
frac-2neg99.7%
distribute-frac-neg99.7%
div-inv99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Applied egg-rr99.8%
+-commutative99.8%
unsub-neg99.8%
div-inv99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 89.0%
Taylor expanded in x around 0 81.7%
associate-*r/81.9%
Simplified81.9%
Final simplification82.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* 60.0 (/ (- x y) z)))))
(if (<= z -9.6e-135)
t_1
(if (<= z 1e-35)
(+ (* a 120.0) (* -60.0 (/ (- x y) t)))
(if (<= z 2.5e+119) (+ (* a 120.0) (* y (/ -60.0 (- z t)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (60.0 * ((x - y) / z));
double tmp;
if (z <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1e-35) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (z <= 2.5e+119) {
tmp = (a * 120.0) + (y * (-60.0 / (z - t)));
} 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) + (60.0d0 * ((x - y) / z))
if (z <= (-9.6d-135)) then
tmp = t_1
else if (z <= 1d-35) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else if (z <= 2.5d+119) then
tmp = (a * 120.0d0) + (y * ((-60.0d0) / (z - t)))
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) + (60.0 * ((x - y) / z));
double tmp;
if (z <= -9.6e-135) {
tmp = t_1;
} else if (z <= 1e-35) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (z <= 2.5e+119) {
tmp = (a * 120.0) + (y * (-60.0 / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (60.0 * ((x - y) / z)) tmp = 0 if z <= -9.6e-135: tmp = t_1 elif z <= 1e-35: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) elif z <= 2.5e+119: tmp = (a * 120.0) + (y * (-60.0 / (z - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))) tmp = 0.0 if (z <= -9.6e-135) tmp = t_1; elseif (z <= 1e-35) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); elseif (z <= 2.5e+119) tmp = Float64(Float64(a * 120.0) + Float64(y * Float64(-60.0 / Float64(z - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (60.0 * ((x - y) / z)); tmp = 0.0; if (z <= -9.6e-135) tmp = t_1; elseif (z <= 1e-35) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); elseif (z <= 2.5e+119) tmp = (a * 120.0) + (y * (-60.0 / (z - t))); 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[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.6e-135], t$95$1, If[LessEqual[z, 1e-35], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+119], N[(N[(a * 120.0), $MachinePrecision] + N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 10^{-35}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+119}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{-60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.5999999999999994e-135 or 2.5e119 < z Initial program 99.7%
Taylor expanded in z around inf 85.2%
if -9.5999999999999994e-135 < z < 1.00000000000000001e-35Initial program 99.8%
Taylor expanded in z around 0 90.7%
if 1.00000000000000001e-35 < z < 2.5e119Initial program 99.8%
Taylor expanded in x around 0 82.7%
associate-*r/82.6%
Simplified82.6%
associate-/l*82.6%
associate-/r/82.6%
Applied egg-rr82.6%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -0.05) (not (<= (* a 120.0) 200000000.0))) (* a 120.0) (* (/ 60.0 (- z t)) (- x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -0.05) || !((a * 120.0) <= 200000000.0)) {
tmp = a * 120.0;
} else {
tmp = (60.0 / (z - t)) * (x - y);
}
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) <= (-0.05d0)) .or. (.not. ((a * 120.0d0) <= 200000000.0d0))) then
tmp = a * 120.0d0
else
tmp = (60.0d0 / (z - t)) * (x - y)
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) <= -0.05) || !((a * 120.0) <= 200000000.0)) {
tmp = a * 120.0;
} else {
tmp = (60.0 / (z - t)) * (x - y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -0.05) or not ((a * 120.0) <= 200000000.0): tmp = a * 120.0 else: tmp = (60.0 / (z - t)) * (x - y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -0.05) || !(Float64(a * 120.0) <= 200000000.0)) tmp = Float64(a * 120.0); else tmp = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -0.05) || ~(((a * 120.0) <= 200000000.0))) tmp = a * 120.0; else tmp = (60.0 / (z - t)) * (x - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -0.05], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 200000000.0]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -0.05 \lor \neg \left(a \cdot 120 \leq 200000000\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\
\end{array}
\end{array}
if (*.f64 a 120) < -0.050000000000000003 or 2e8 < (*.f64 a 120) Initial program 99.8%
Taylor expanded in z around inf 80.1%
if -0.050000000000000003 < (*.f64 a 120) < 2e8Initial program 99.6%
*-commutative99.6%
associate-/l*99.6%
frac-2neg99.6%
distribute-frac-neg99.6%
div-inv99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
+-commutative99.6%
unsub-neg99.6%
div-inv99.5%
*-commutative99.5%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 76.2%
associate-*r/76.2%
associate-/l*76.3%
associate-/r/76.3%
Simplified76.3%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -0.05) (- (* a 120.0) (* 60.0 (/ x t))) (if (<= (* a 120.0) 200000000.0) (* (/ 60.0 (- z t)) (- x y)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -0.05) {
tmp = (a * 120.0) - (60.0 * (x / t));
} else if ((a * 120.0) <= 200000000.0) {
tmp = (60.0 / (z - t)) * (x - 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) <= (-0.05d0)) then
tmp = (a * 120.0d0) - (60.0d0 * (x / t))
else if ((a * 120.0d0) <= 200000000.0d0) then
tmp = (60.0d0 / (z - t)) * (x - 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) <= -0.05) {
tmp = (a * 120.0) - (60.0 * (x / t));
} else if ((a * 120.0) <= 200000000.0) {
tmp = (60.0 / (z - t)) * (x - y);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -0.05: tmp = (a * 120.0) - (60.0 * (x / t)) elif (a * 120.0) <= 200000000.0: tmp = (60.0 / (z - t)) * (x - y) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -0.05) tmp = Float64(Float64(a * 120.0) - Float64(60.0 * Float64(x / t))); elseif (Float64(a * 120.0) <= 200000000.0) tmp = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - 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) <= -0.05) tmp = (a * 120.0) - (60.0 * (x / t)); elseif ((a * 120.0) <= 200000000.0) tmp = (60.0 / (z - t)) * (x - y); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -0.05], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 200000000.0], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -0.05:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t}\\
\mathbf{elif}\;a \cdot 120 \leq 200000000:\\
\;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a 120) < -0.050000000000000003Initial program 99.9%
*-commutative99.9%
associate-/l*99.9%
frac-2neg99.9%
distribute-frac-neg99.9%
div-inv99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y around 0 81.2%
if -0.050000000000000003 < (*.f64 a 120) < 2e8Initial program 99.6%
*-commutative99.6%
associate-/l*99.6%
frac-2neg99.6%
distribute-frac-neg99.6%
div-inv99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
+-commutative99.6%
unsub-neg99.6%
div-inv99.5%
*-commutative99.5%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 76.2%
associate-*r/76.2%
associate-/l*76.3%
associate-/r/76.3%
Simplified76.3%
if 2e8 < (*.f64 a 120) Initial program 99.8%
Taylor expanded in z around inf 79.1%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ y (- z t)))))
(if (<= y -4.4e+112)
t_1
(if (<= y 7.2e-46)
(* a 120.0)
(if (<= y 35000.0)
(* (/ 60.0 (- z t)) x)
(if (<= y 4.6e+200) (* 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 <= -4.4e+112) {
tmp = t_1;
} else if (y <= 7.2e-46) {
tmp = a * 120.0;
} else if (y <= 35000.0) {
tmp = (60.0 / (z - t)) * x;
} else if (y <= 4.6e+200) {
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 <= (-4.4d+112)) then
tmp = t_1
else if (y <= 7.2d-46) then
tmp = a * 120.0d0
else if (y <= 35000.0d0) then
tmp = (60.0d0 / (z - t)) * x
else if (y <= 4.6d+200) 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 <= -4.4e+112) {
tmp = t_1;
} else if (y <= 7.2e-46) {
tmp = a * 120.0;
} else if (y <= 35000.0) {
tmp = (60.0 / (z - t)) * x;
} else if (y <= 4.6e+200) {
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 <= -4.4e+112: tmp = t_1 elif y <= 7.2e-46: tmp = a * 120.0 elif y <= 35000.0: tmp = (60.0 / (z - t)) * x elif y <= 4.6e+200: 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 <= -4.4e+112) tmp = t_1; elseif (y <= 7.2e-46) tmp = Float64(a * 120.0); elseif (y <= 35000.0) tmp = Float64(Float64(60.0 / Float64(z - t)) * x); elseif (y <= 4.6e+200) 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 <= -4.4e+112) tmp = t_1; elseif (y <= 7.2e-46) tmp = a * 120.0; elseif (y <= 35000.0) tmp = (60.0 / (z - t)) * x; elseif (y <= 4.6e+200) 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, -4.4e+112], t$95$1, If[LessEqual[y, 7.2e-46], N[(a * 120.0), $MachinePrecision], If[LessEqual[y, 35000.0], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 4.6e+200], 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 -4.4 \cdot 10^{+112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-46}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;y \leq 35000:\\
\;\;\;\;\frac{60}{z - t} \cdot x\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+200}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.3999999999999999e112 or 4.60000000000000006e200 < y Initial program 99.7%
*-commutative99.7%
associate-/l*99.7%
frac-2neg99.7%
distribute-frac-neg99.7%
div-inv99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
Applied egg-rr99.7%
+-commutative99.7%
unsub-neg99.7%
div-inv99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 65.8%
*-commutative65.8%
Simplified65.8%
if -4.3999999999999999e112 < y < 7.2e-46 or 35000 < y < 4.60000000000000006e200Initial program 99.8%
Taylor expanded in z around inf 62.5%
if 7.2e-46 < y < 35000Initial program 99.4%
*-commutative99.4%
associate-/l*99.1%
frac-2neg99.1%
distribute-frac-neg99.1%
div-inv99.3%
distribute-rgt-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
+-commutative99.3%
unsub-neg99.3%
div-inv99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 74.1%
associate-*r/74.2%
Simplified74.2%
associate-/l*74.5%
associate-/r/74.5%
Applied egg-rr74.5%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.6e-135) (not (<= z 2.35e+119))) (+ (* a 120.0) (* 60.0 (/ (- x y) z))) (+ (* a 120.0) (* -60.0 (/ (- x y) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.6e-135) || !(z <= 2.35e+119)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + (-60.0 * ((x - 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 ((z <= (-9.6d-135)) .or. (.not. (z <= 2.35d+119))) then
tmp = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
else
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - 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 ((z <= -9.6e-135) || !(z <= 2.35e+119)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.6e-135) or not (z <= 2.35e+119): tmp = (a * 120.0) + (60.0 * ((x - y) / z)) else: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.6e-135) || !(z <= 2.35e+119)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))); else tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.6e-135) || ~((z <= 2.35e+119))) tmp = (a * 120.0) + (60.0 * ((x - y) / z)); else tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.6e-135], N[Not[LessEqual[z, 2.35e+119]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-135} \lor \neg \left(z \leq 2.35 \cdot 10^{+119}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if z < -9.5999999999999994e-135 or 2.35000000000000004e119 < z Initial program 99.7%
Taylor expanded in z around inf 85.2%
if -9.5999999999999994e-135 < z < 2.35000000000000004e119Initial program 99.8%
Taylor expanded in z around 0 85.4%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -1.52e+78) (not (<= x 145000.0))) (+ (* a 120.0) (/ (* 60.0 x) (- z t))) (+ (* a 120.0) (* y (/ -60.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.52e+78) || !(x <= 145000.0)) {
tmp = (a * 120.0) + ((60.0 * x) / (z - t));
} else {
tmp = (a * 120.0) + (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 ((x <= (-1.52d+78)) .or. (.not. (x <= 145000.0d0))) then
tmp = (a * 120.0d0) + ((60.0d0 * x) / (z - t))
else
tmp = (a * 120.0d0) + (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 ((x <= -1.52e+78) || !(x <= 145000.0)) {
tmp = (a * 120.0) + ((60.0 * x) / (z - t));
} else {
tmp = (a * 120.0) + (y * (-60.0 / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -1.52e+78) or not (x <= 145000.0): tmp = (a * 120.0) + ((60.0 * x) / (z - t)) else: tmp = (a * 120.0) + (y * (-60.0 / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -1.52e+78) || !(x <= 145000.0)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * x) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(y * Float64(-60.0 / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -1.52e+78) || ~((x <= 145000.0))) tmp = (a * 120.0) + ((60.0 * x) / (z - t)); else tmp = (a * 120.0) + (y * (-60.0 / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.52e+78], N[Not[LessEqual[x, 145000.0]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.52 \cdot 10^{+78} \lor \neg \left(x \leq 145000\right):\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{-60}{z - t}\\
\end{array}
\end{array}
if x < -1.52e78 or 145000 < x Initial program 99.6%
Taylor expanded in x around inf 89.1%
associate-*r/89.2%
Simplified89.2%
if -1.52e78 < x < 145000Initial program 99.8%
Taylor expanded in x around 0 95.9%
associate-*r/95.9%
Simplified95.9%
associate-/l*95.9%
associate-/r/95.9%
Applied egg-rr95.9%
Final simplification93.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.35e-9) (not (<= a 600000000.0))) (* 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 <= -1.35e-9) || !(a <= 600000000.0)) {
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 <= (-1.35d-9)) .or. (.not. (a <= 600000000.0d0))) 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 <= -1.35e-9) || !(a <= 600000000.0)) {
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 <= -1.35e-9) or not (a <= 600000000.0): 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 ((a <= -1.35e-9) || !(a <= 600000000.0)) 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 <= -1.35e-9) || ~((a <= 600000000.0))) 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[a, -1.35e-9], N[Not[LessEqual[a, 600000000.0]], $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 \leq -1.35 \cdot 10^{-9} \lor \neg \left(a \leq 600000000\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if a < -1.3500000000000001e-9 or 6e8 < a Initial program 99.8%
Taylor expanded in z around inf 80.1%
if -1.3500000000000001e-9 < a < 6e8Initial program 99.6%
+-commutative99.6%
fma-def99.6%
associate-*l/99.7%
Simplified99.7%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 76.2%
Final simplification78.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(Float64(60.0 / 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[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{z - t} \cdot \left(x - y\right) + a \cdot 120
\end{array}
Initial program 99.7%
associate-*l/99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.55e-114) (not (<= a 950000.0))) (* a 120.0) (* -60.0 (/ (- x y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e-114) || !(a <= 950000.0)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * ((x - 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 ((a <= (-1.55d-114)) .or. (.not. (a <= 950000.0d0))) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * ((x - 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 ((a <= -1.55e-114) || !(a <= 950000.0)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * ((x - y) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.55e-114) or not (a <= 950000.0): tmp = a * 120.0 else: tmp = -60.0 * ((x - y) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.55e-114) || !(a <= 950000.0)) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(Float64(x - y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.55e-114) || ~((a <= 950000.0))) tmp = a * 120.0; else tmp = -60.0 * ((x - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.55e-114], N[Not[LessEqual[a, 950000.0]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{-114} \lor \neg \left(a \leq 950000\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if a < -1.55e-114 or 9.5e5 < a Initial program 99.8%
Taylor expanded in z around inf 74.2%
if -1.55e-114 < a < 9.5e5Initial program 99.6%
+-commutative99.6%
fma-def99.6%
associate-*l/99.7%
Simplified99.7%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 78.1%
Taylor expanded in z around 0 39.1%
Final simplification58.7%
(FPCore (x y z t a) :precision binary64 (if (<= x 1e+243) (* a 120.0) (* -60.0 (/ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 1e+243) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / 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 (x <= 1d+243) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 1e+243) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= 1e+243: tmp = a * 120.0 else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= 1e+243) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= 1e+243) tmp = a * 120.0; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, 1e+243], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+243}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if x < 1.0000000000000001e243Initial program 99.7%
Taylor expanded in z around inf 53.4%
if 1.0000000000000001e243 < x Initial program 99.4%
*-commutative99.4%
associate-/l*99.5%
frac-2neg99.5%
distribute-frac-neg99.5%
div-inv99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in x around inf 54.3%
Final simplification53.5%
(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.7%
Taylor expanded in z around inf 51.5%
Final simplification51.5%
(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 2023306
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:herbie-target
(+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))