
(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 (- 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}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.2e+203)
(+ (* a 120.0) (* 60.0 (/ x z)))
(if (<= z -4.9e+157)
(* 60.0 (/ (- x y) (- z t)))
(if (<= z -165.0)
(+ (* a 120.0) (* -60.0 (/ y z)))
(if (<= z 3.3e-78)
(+ (* a 120.0) (* -60.0 (/ (- x y) t)))
(+ (* a 120.0) (/ 60.0 (/ z x))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+203) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else if (z <= -4.9e+157) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (z <= -165.0) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (z <= 3.3e-78) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (60.0 / (z / x));
}
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 <= (-3.2d+203)) then
tmp = (a * 120.0d0) + (60.0d0 * (x / z))
else if (z <= (-4.9d+157)) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if (z <= (-165.0d0)) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else if (z <= 3.3d-78) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else
tmp = (a * 120.0d0) + (60.0d0 / (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+203) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else if (z <= -4.9e+157) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (z <= -165.0) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (z <= 3.3e-78) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (60.0 / (z / x));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.2e+203: tmp = (a * 120.0) + (60.0 * (x / z)) elif z <= -4.9e+157: tmp = 60.0 * ((x - y) / (z - t)) elif z <= -165.0: tmp = (a * 120.0) + (-60.0 * (y / z)) elif z <= 3.3e-78: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) else: tmp = (a * 120.0) + (60.0 / (z / x)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e+203) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z))); elseif (z <= -4.9e+157) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (z <= -165.0) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); elseif (z <= 3.3e-78) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.2e+203) tmp = (a * 120.0) + (60.0 * (x / z)); elseif (z <= -4.9e+157) tmp = 60.0 * ((x - y) / (z - t)); elseif (z <= -165.0) tmp = (a * 120.0) + (-60.0 * (y / z)); elseif (z <= 3.3e-78) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); else tmp = (a * 120.0) + (60.0 / (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+203], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.9e+157], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -165.0], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e-78], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+203}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{+157}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;z \leq -165:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-78}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -3.1999999999999997e203Initial program 99.8%
Taylor expanded in z around inf 100.0%
Taylor expanded in x around inf 95.2%
if -3.1999999999999997e203 < z < -4.9000000000000001e157Initial program 99.6%
*-commutative99.6%
associate-/l*99.2%
div-inv99.2%
*-un-lft-identity99.2%
times-frac99.6%
metadata-eval99.6%
Applied egg-rr99.6%
clear-num98.8%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in a around 0 87.0%
if -4.9000000000000001e157 < z < -165Initial program 99.9%
Taylor expanded in z around inf 89.0%
Taylor expanded in x around 0 79.4%
if -165 < z < 3.29999999999999982e-78Initial program 99.8%
Taylor expanded in z around 0 84.5%
if 3.29999999999999982e-78 < z Initial program 99.8%
Taylor expanded in z around inf 89.7%
clear-num89.7%
un-div-inv89.7%
Applied egg-rr89.7%
Taylor expanded in x around inf 79.4%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -5e-54) (not (<= (* a 120.0) 5e-56))) (* 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) <= -5e-54) || !((a * 120.0) <= 5e-56)) {
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) <= (-5d-54)) .or. (.not. ((a * 120.0d0) <= 5d-56))) 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) <= -5e-54) || !((a * 120.0) <= 5e-56)) {
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) <= -5e-54) or not ((a * 120.0) <= 5e-56): 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) <= -5e-54) || !(Float64(a * 120.0) <= 5e-56)) 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) <= -5e-54) || ~(((a * 120.0) <= 5e-56))) 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], -5e-54], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-56]], $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 -5 \cdot 10^{-54} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-56}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a 120) < -5.00000000000000015e-54 or 4.99999999999999997e-56 < (*.f64 a 120) Initial program 99.9%
Taylor expanded in z around inf 77.5%
if -5.00000000000000015e-54 < (*.f64 a 120) < 4.99999999999999997e-56Initial program 99.7%
*-commutative99.7%
associate-/l*99.6%
div-inv99.6%
*-un-lft-identity99.6%
times-frac99.6%
metadata-eval99.6%
Applied egg-rr99.6%
clear-num99.5%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 81.6%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9.2e+119) (not (<= y 2.05e+152))) (* 60.0 (/ (- x y) (- 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 <= -9.2e+119) || !(y <= 2.05e+152)) {
tmp = 60.0 * ((x - y) / (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 <= (-9.2d+119)) .or. (.not. (y <= 2.05d+152))) then
tmp = 60.0d0 * ((x - y) / (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 <= -9.2e+119) || !(y <= 2.05e+152)) {
tmp = 60.0 * ((x - y) / (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 <= -9.2e+119) or not (y <= 2.05e+152): tmp = 60.0 * ((x - y) / (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 <= -9.2e+119) || !(y <= 2.05e+152)) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9.2e+119) || ~((y <= 2.05e+152))) tmp = 60.0 * ((x - y) / (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, -9.2e+119], N[Not[LessEqual[y, 2.05e+152]], $MachinePrecision]], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+119} \lor \neg \left(y \leq 2.05 \cdot 10^{+152}\right):\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if y < -9.2000000000000003e119 or 2.0499999999999999e152 < y Initial program 99.8%
*-commutative99.8%
associate-/l*99.7%
div-inv99.8%
*-un-lft-identity99.8%
times-frac99.8%
metadata-eval99.8%
Applied egg-rr99.8%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 78.4%
if -9.2000000000000003e119 < y < 2.0499999999999999e152Initial program 99.8%
Taylor expanded in x around inf 92.1%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.3e-63) (not (<= t 9.2e+14))) (+ (* a 120.0) (* -60.0 (/ (- x y) t))) (+ (* a 120.0) (* 60.0 (/ (- x y) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.3e-63) || !(t <= 9.2e+14)) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (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 ((t <= (-4.3d-63)) .or. (.not. (t <= 9.2d+14))) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else
tmp = (a * 120.0d0) + (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 ((t <= -4.3e-63) || !(t <= 9.2e+14)) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.3e-63) or not (t <= 9.2e+14): tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) else: tmp = (a * 120.0) + (60.0 * ((x - y) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.3e-63) || !(t <= 9.2e+14)) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); else tmp = Float64(Float64(a * 120.0) + 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 ((t <= -4.3e-63) || ~((t <= 9.2e+14))) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); else tmp = (a * 120.0) + (60.0 * ((x - y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.3e-63], N[Not[LessEqual[t, 9.2e+14]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-63} \lor \neg \left(t \leq 9.2 \cdot 10^{+14}\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if t < -4.2999999999999999e-63 or 9.2e14 < t Initial program 99.9%
Taylor expanded in z around 0 88.1%
if -4.2999999999999999e-63 < t < 9.2e14Initial program 99.8%
Taylor expanded in z around inf 89.1%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9.5e+118) (not (<= y 1.7e+156))) (+ (* 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 <= -9.5e+118) || !(y <= 1.7e+156)) {
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 <= (-9.5d+118)) .or. (.not. (y <= 1.7d+156))) 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 <= -9.5e+118) || !(y <= 1.7e+156)) {
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 <= -9.5e+118) or not (y <= 1.7e+156): 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 <= -9.5e+118) || !(y <= 1.7e+156)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9.5e+118) || ~((y <= 1.7e+156))) 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, -9.5e+118], N[Not[LessEqual[y, 1.7e+156]], $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[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+118} \lor \neg \left(y \leq 1.7 \cdot 10^{+156}\right):\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if y < -9.49999999999999974e118 or 1.7e156 < y Initial program 99.8%
Taylor expanded in x around 0 91.3%
associate-*r/91.4%
Simplified91.4%
if -9.49999999999999974e118 < y < 1.7e156Initial program 99.8%
Taylor expanded in x around inf 92.1%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -8.6e+117) (not (<= y 1.7e+156))) (+ (* 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 <= -8.6e+117) || !(y <= 1.7e+156)) {
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 <= (-8.6d+117)) .or. (.not. (y <= 1.7d+156))) 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 <= -8.6e+117) || !(y <= 1.7e+156)) {
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 <= -8.6e+117) or not (y <= 1.7e+156): 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 <= -8.6e+117) || !(y <= 1.7e+156)) 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 <= -8.6e+117) || ~((y <= 1.7e+156))) 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, -8.6e+117], N[Not[LessEqual[y, 1.7e+156]], $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 -8.6 \cdot 10^{+117} \lor \neg \left(y \leq 1.7 \cdot 10^{+156}\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 < -8.59999999999999996e117 or 1.7e156 < y Initial program 99.8%
Taylor expanded in x around 0 91.3%
associate-*r/91.4%
Simplified91.4%
if -8.59999999999999996e117 < y < 1.7e156Initial program 99.8%
Taylor expanded in x around inf 92.1%
associate-*r/92.2%
Simplified92.2%
Final simplification91.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.8e-63)
(+ (* a 120.0) (* -60.0 (/ (- x y) t)))
(if (<= t 4.6e+14)
(+ (* a 120.0) (* 60.0 (/ (- x y) z)))
(+ (* a 120.0) (* (- x y) (/ -60.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e-63) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (t <= 4.6e+14) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + ((x - 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 (t <= (-2.8d-63)) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else if (t <= 4.6d+14) then
tmp = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
else
tmp = (a * 120.0d0) + ((x - 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 (t <= -2.8e-63) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (t <= 4.6e+14) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.8e-63: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) elif t <= 4.6e+14: tmp = (a * 120.0) + (60.0 * ((x - y) / z)) else: tmp = (a * 120.0) + ((x - y) * (-60.0 / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8e-63) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); elseif (t <= 4.6e+14) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))); else tmp = Float64(Float64(a * 120.0) + Float64(Float64(x - y) * Float64(-60.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.8e-63) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); elseif (t <= 4.6e+14) tmp = (a * 120.0) + (60.0 * ((x - y) / z)); else tmp = (a * 120.0) + ((x - y) * (-60.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8e-63], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+14], 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[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-63}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+14}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if t < -2.8000000000000002e-63Initial program 99.9%
Taylor expanded in z around 0 84.5%
if -2.8000000000000002e-63 < t < 4.6e14Initial program 99.8%
Taylor expanded in z around inf 89.1%
if 4.6e14 < t Initial program 99.8%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 91.5%
Final simplification88.6%
(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.8%
associate-*l/99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.6e+156) (* a 120.0) (* (* y -60.0) (/ 1.0 z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.6e+156) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) * (1.0 / z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 1.6d+156) then
tmp = a * 120.0d0
else
tmp = (y * (-60.0d0)) * (1.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.6e+156) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) * (1.0 / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.6e+156: tmp = a * 120.0 else: tmp = (y * -60.0) * (1.0 / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.6e+156) tmp = Float64(a * 120.0); else tmp = Float64(Float64(y * -60.0) * Float64(1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 1.6e+156) tmp = a * 120.0; else tmp = (y * -60.0) * (1.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.6e+156], N[(a * 120.0), $MachinePrecision], N[(N[(y * -60.0), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{+156}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -60\right) \cdot \frac{1}{z}\\
\end{array}
\end{array}
if y < 1.60000000000000001e156Initial program 99.8%
Taylor expanded in z around inf 56.6%
if 1.60000000000000001e156 < y Initial program 99.8%
Taylor expanded in z around inf 64.1%
Taylor expanded in y around inf 46.2%
associate-*r/46.3%
clear-num46.2%
Applied egg-rr46.2%
associate-/r/46.3%
Simplified46.3%
Final simplification55.3%
(FPCore (x y z t a) :precision binary64 (if (<= y 2.85e+155) (* a 120.0) (* -60.0 (/ y z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.85e+155) {
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 (y <= 2.85d+155) 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 (y <= 2.85e+155) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 2.85e+155: tmp = a * 120.0 else: tmp = -60.0 * (y / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 2.85e+155) 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 (y <= 2.85e+155) tmp = a * 120.0; else tmp = -60.0 * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 2.85e+155], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.85 \cdot 10^{+155}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if y < 2.8499999999999998e155Initial program 99.8%
Taylor expanded in z around inf 56.6%
if 2.8499999999999998e155 < y Initial program 99.8%
Taylor expanded in z around inf 64.1%
Taylor expanded in y around inf 46.2%
Final simplification55.3%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.52e+156) (* a 120.0) (/ (* y -60.0) z)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.52e+156) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / z;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 1.52d+156) then
tmp = a * 120.0d0
else
tmp = (y * (-60.0d0)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.52e+156) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.52e+156: tmp = a * 120.0 else: tmp = (y * -60.0) / z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.52e+156) tmp = Float64(a * 120.0); else tmp = Float64(Float64(y * -60.0) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 1.52e+156) tmp = a * 120.0; else tmp = (y * -60.0) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.52e+156], N[(a * 120.0), $MachinePrecision], N[(N[(y * -60.0), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.52 \cdot 10^{+156}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z}\\
\end{array}
\end{array}
if y < 1.52e156Initial program 99.8%
Taylor expanded in z around inf 56.6%
if 1.52e156 < y Initial program 99.8%
Taylor expanded in z around inf 64.1%
Taylor expanded in y around inf 46.2%
associate-*r/46.3%
Applied egg-rr46.3%
Final simplification55.3%
(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.8%
Taylor expanded in z around inf 52.0%
Final simplification52.0%
(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 2023308
(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)))