
(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 13 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 (+ (/ 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}
Initial program 99.1%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= (- z t) -1e+110)
(* a 120.0)
(if (<= (- z t) -5e+57)
(* -60.0 (/ (- x y) t))
(if (or (<= (- z t) -0.05) (not (<= (- z t) 2e-19)))
(* a 120.0)
(* 60.0 (/ (- x y) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z - t) <= -1e+110) {
tmp = a * 120.0;
} else if ((z - t) <= -5e+57) {
tmp = -60.0 * ((x - y) / t);
} else if (((z - t) <= -0.05) || !((z - t) <= 2e-19)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - 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 ((z - t) <= (-1d+110)) then
tmp = a * 120.0d0
else if ((z - t) <= (-5d+57)) then
tmp = (-60.0d0) * ((x - y) / t)
else if (((z - t) <= (-0.05d0)) .or. (.not. ((z - t) <= 2d-19))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * ((x - 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 ((z - t) <= -1e+110) {
tmp = a * 120.0;
} else if ((z - t) <= -5e+57) {
tmp = -60.0 * ((x - y) / t);
} else if (((z - t) <= -0.05) || !((z - t) <= 2e-19)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z - t) <= -1e+110: tmp = a * 120.0 elif (z - t) <= -5e+57: tmp = -60.0 * ((x - y) / t) elif ((z - t) <= -0.05) or not ((z - t) <= 2e-19): tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(z - t) <= -1e+110) tmp = Float64(a * 120.0); elseif (Float64(z - t) <= -5e+57) tmp = Float64(-60.0 * Float64(Float64(x - y) / t)); elseif ((Float64(z - t) <= -0.05) || !(Float64(z - t) <= 2e-19)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(Float64(x - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z - t) <= -1e+110) tmp = a * 120.0; elseif ((z - t) <= -5e+57) tmp = -60.0 * ((x - y) / t); elseif (((z - t) <= -0.05) || ~(((z - t) <= 2e-19))) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z - t), $MachinePrecision], -1e+110], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(z - t), $MachinePrecision], -5e+57], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(z - t), $MachinePrecision], -0.05], N[Not[LessEqual[N[(z - t), $MachinePrecision], 2e-19]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -1 \cdot 10^{+110}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;z - t \leq -5 \cdot 10^{+57}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{elif}\;z - t \leq -0.05 \lor \neg \left(z - t \leq 2 \cdot 10^{-19}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if (-.f64 z t) < -1e110 or -4.99999999999999972e57 < (-.f64 z t) < -0.050000000000000003 or 2e-19 < (-.f64 z t) Initial program 98.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 63.2%
if -1e110 < (-.f64 z t) < -4.99999999999999972e57Initial program 99.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in z around 0 64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in a around 0 71.6%
if -0.050000000000000003 < (-.f64 z t) < 2e-19Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 81.5%
Taylor expanded in z around inf 64.2%
Final simplification63.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -2e+41) (not (<= (* a 120.0) 1e-132))) (+ (* a 120.0) (/ 60.0 (/ (- z t) x))) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -2e+41) || !((a * 120.0) <= 1e-132)) {
tmp = (a * 120.0) + (60.0 / ((z - t) / x));
} 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) <= (-2d+41)) .or. (.not. ((a * 120.0d0) <= 1d-132))) then
tmp = (a * 120.0d0) + (60.0d0 / ((z - t) / x))
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) <= -2e+41) || !((a * 120.0) <= 1e-132)) {
tmp = (a * 120.0) + (60.0 / ((z - t) / x));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -2e+41) or not ((a * 120.0) <= 1e-132): tmp = (a * 120.0) + (60.0 / ((z - t) / x)) 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) <= -2e+41) || !(Float64(a * 120.0) <= 1e-132)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(Float64(z - t) / x))); 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) <= -2e+41) || ~(((a * 120.0) <= 1e-132))) tmp = (a * 120.0) + (60.0 / ((z - t) / x)); 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], -2e+41], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-132]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $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 -2 \cdot 10^{+41} \lor \neg \left(a \cdot 120 \leq 10^{-132}\right):\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{z - t}{x}}\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -2.00000000000000001e41 or 9.9999999999999999e-133 < (*.f64 a #s(literal 120 binary64)) Initial program 99.3%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 89.6%
if -2.00000000000000001e41 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999999e-133Initial program 98.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 83.4%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -2e+43) (not (<= (* a 120.0) 1e-132))) (+ (* a 120.0) (* x (/ 60.0 (- z t)))) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -2e+43) || !((a * 120.0) <= 1e-132)) {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a * 120.0d0) <= (-2d+43)) .or. (.not. ((a * 120.0d0) <= 1d-132))) then
tmp = (a * 120.0d0) + (x * (60.0d0 / (z - t)))
else
tmp = 60.0d0 * ((x - y) / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -2e+43) || !((a * 120.0) <= 1e-132)) {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -2e+43) or not ((a * 120.0) <= 1e-132): tmp = (a * 120.0) + (x * (60.0 / (z - t))) 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) <= -2e+43) || !(Float64(a * 120.0) <= 1e-132)) tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t)))); else tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -2e+43) || ~(((a * 120.0) <= 1e-132))) tmp = (a * 120.0) + (x * (60.0 / (z - t))); 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], -2e+43], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-132]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -2 \cdot 10^{+43} \lor \neg \left(a \cdot 120 \leq 10^{-132}\right):\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -2.00000000000000003e43 or 9.9999999999999999e-133 < (*.f64 a #s(literal 120 binary64)) Initial program 99.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 89.4%
associate-*r/88.9%
*-commutative88.9%
associate-*r/89.5%
Simplified89.5%
if -2.00000000000000003e43 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999999e-133Initial program 98.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 83.5%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -1e+62) (+ (* a 120.0) (* -60.0 (/ y z))) (if (<= (* a 120.0) 1e-14) (* 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) <= -1e+62) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if ((a * 120.0) <= 1e-14) {
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) <= (-1d+62)) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else if ((a * 120.0d0) <= 1d-14) 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) <= -1e+62) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if ((a * 120.0) <= 1e-14) {
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) <= -1e+62: tmp = (a * 120.0) + (-60.0 * (y / z)) elif (a * 120.0) <= 1e-14: 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) <= -1e+62) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); elseif (Float64(a * 120.0) <= 1e-14) 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) <= -1e+62) tmp = (a * 120.0) + (-60.0 * (y / z)); elseif ((a * 120.0) <= 1e-14) 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], -1e+62], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-14], 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 -1 \cdot 10^{+62}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-14}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1.00000000000000004e62Initial program 98.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 88.4%
associate-*r/88.4%
Simplified88.4%
Taylor expanded in z around inf 81.1%
if -1.00000000000000004e62 < (*.f64 a #s(literal 120 binary64)) < 9.99999999999999999e-15Initial program 99.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 79.7%
if 9.99999999999999999e-15 < (*.f64 a #s(literal 120 binary64)) Initial program 100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 80.2%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -0.0037) (not (<= x 2.9e+84))) (+ (* a 120.0) (/ 60.0 (/ (- z t) x))) (+ (* a 120.0) (/ (* y -60.0) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -0.0037) || !(x <= 2.9e+84)) {
tmp = (a * 120.0) + (60.0 / ((z - t) / x));
} 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 <= (-0.0037d0)) .or. (.not. (x <= 2.9d+84))) then
tmp = (a * 120.0d0) + (60.0d0 / ((z - t) / x))
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 <= -0.0037) || !(x <= 2.9e+84)) {
tmp = (a * 120.0) + (60.0 / ((z - t) / x));
} else {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -0.0037) or not (x <= 2.9e+84): tmp = (a * 120.0) + (60.0 / ((z - t) / x)) else: tmp = (a * 120.0) + ((y * -60.0) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -0.0037) || !(x <= 2.9e+84)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(Float64(z - t) / x))); else tmp = Float64(Float64(a * 120.0) + 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 ((x <= -0.0037) || ~((x <= 2.9e+84))) tmp = (a * 120.0) + (60.0 / ((z - t) / x)); 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, -0.0037], N[Not[LessEqual[x, 2.9e+84]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0037 \lor \neg \left(x \leq 2.9 \cdot 10^{+84}\right):\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{z - t}{x}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\end{array}
\end{array}
if x < -0.0037000000000000002 or 2.89999999999999989e84 < x Initial program 99.0%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 92.5%
if -0.0037000000000000002 < x < 2.89999999999999989e84Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 97.8%
associate-*r/97.1%
Simplified97.1%
Final simplification95.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.88e+59) (not (<= a 3.7e-11))) (* 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.88e+59) || !(a <= 3.7e-11)) {
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.88d+59)) .or. (.not. (a <= 3.7d-11))) 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.88e+59) || !(a <= 3.7e-11)) {
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.88e+59) or not (a <= 3.7e-11): 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.88e+59) || !(a <= 3.7e-11)) 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.88e+59) || ~((a <= 3.7e-11))) 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.88e+59], N[Not[LessEqual[a, 3.7e-11]], $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.88 \cdot 10^{+59} \lor \neg \left(a \leq 3.7 \cdot 10^{-11}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if a < -1.87999999999999989e59 or 3.7000000000000001e-11 < a Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
if -1.87999999999999989e59 < a < 3.7000000000000001e-11Initial program 99.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 79.7%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.15e+58) (not (<= a 6.7e-65))) (* 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.15e+58) || !(a <= 6.7e-65)) {
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.15d+58)) .or. (.not. (a <= 6.7d-65))) 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.15e+58) || !(a <= 6.7e-65)) {
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.15e+58) or not (a <= 6.7e-65): 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.15e+58) || !(a <= 6.7e-65)) 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.15e+58) || ~((a <= 6.7e-65))) 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.15e+58], N[Not[LessEqual[a, 6.7e-65]], $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.15 \cdot 10^{+58} \lor \neg \left(a \leq 6.7 \cdot 10^{-65}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if a < -1.15000000000000001e58 or 6.7000000000000004e-65 < a Initial program 99.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 77.2%
if -1.15000000000000001e58 < a < 6.7000000000000004e-65Initial program 99.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around inf 85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in z around 0 48.9%
*-commutative48.9%
Simplified48.9%
Taylor expanded in a around 0 43.6%
Final simplification61.0%
(FPCore (x y z t a) :precision binary64 (+ (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (a * 120.0d0) + (60.0d0 * ((x - y) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
def code(x, y, z, t, a): return (a * 120.0) + (60.0 * ((x - y) / (z - t)))
function code(x, y, z, t, a) return Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = (a * 120.0) + (60.0 * ((x - y) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120 + 60 \cdot \frac{x - y}{z - t}
\end{array}
Initial program 99.1%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.65e+130) (/ (* 60.0 y) t) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.65e+130) {
tmp = (60.0 * y) / 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 <= (-1.65d+130)) then
tmp = (60.0d0 * y) / 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 <= -1.65e+130) {
tmp = (60.0 * y) / t;
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.65e+130: tmp = (60.0 * y) / t else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.65e+130) tmp = Float64(Float64(60.0 * y) / 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 <= -1.65e+130) tmp = (60.0 * y) / t; else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.65e+130], N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+130}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -1.65e130Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in z around 0 57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in y around inf 43.9%
associate-*r/44.0%
Simplified44.0%
if -1.65e130 < y Initial program 99.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 54.9%
Final simplification53.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.5e+128) (* 60.0 (/ y t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.5e+128) {
tmp = 60.0 * (y / 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 <= (-1.5d+128)) then
tmp = 60.0d0 * (y / 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 <= -1.5e+128) {
tmp = 60.0 * (y / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.5e+128: tmp = 60.0 * (y / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.5e+128) tmp = Float64(60.0 * Float64(y / 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 <= -1.5e+128) tmp = 60.0 * (y / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.5e+128], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+128}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -1.4999999999999999e128Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in z around 0 57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in y around inf 43.9%
if -1.4999999999999999e128 < y Initial program 99.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 54.9%
Final simplification53.4%
(FPCore (x y z t a) :precision binary64 (if (<= x 3.4e+152) (* a 120.0) (* 60.0 (/ x z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 3.4e+152) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (x / z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= 3.4d+152) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 3.4e+152) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (x / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= 3.4e+152: tmp = a * 120.0 else: tmp = 60.0 * (x / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= 3.4e+152) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= 3.4e+152) tmp = a * 120.0; else tmp = 60.0 * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, 3.4e+152], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.4 \cdot 10^{+152}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\end{array}
\end{array}
if x < 3.4000000000000002e152Initial program 99.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 54.8%
if 3.4000000000000002e152 < x Initial program 99.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 73.1%
Taylor expanded in x around inf 66.1%
associate-*r/92.8%
*-commutative92.8%
associate-*r/92.7%
Simplified66.2%
Taylor expanded in z around inf 46.1%
Final simplification53.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%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 50.4%
Final simplification50.4%
(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 2024085
(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)))