
(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 12 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 (/ (- y x) (- t z))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 * ((y - x) / (t - z))) + (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 * ((y - x) / (t - z))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 * ((y - x) / (t - z))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 * ((y - x) / (t - z))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 * Float64(Float64(y - x) / Float64(t - z))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 * ((y - x) / (t - z))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 * N[(N[(y - x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
60 \cdot \frac{y - x}{t - z} + a \cdot 120
\end{array}
Initial program 99.0%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -5e+35) (not (<= t_1 4e+129)))
(* 60.0 (/ (- y x) (- t z)))
(- (* a 120.0) (* 60.0 (/ x (- t z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+35) || !(t_1 <= 4e+129)) {
tmp = 60.0 * ((y - x) / (t - z));
} else {
tmp = (a * 120.0) - (60.0 * (x / (t - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if ((t_1 <= (-5d+35)) .or. (.not. (t_1 <= 4d+129))) then
tmp = 60.0d0 * ((y - x) / (t - z))
else
tmp = (a * 120.0d0) - (60.0d0 * (x / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+35) || !(t_1 <= 4e+129)) {
tmp = 60.0 * ((y - x) / (t - z));
} else {
tmp = (a * 120.0) - (60.0 * (x / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if (t_1 <= -5e+35) or not (t_1 <= 4e+129): tmp = 60.0 * ((y - x) / (t - z)) else: tmp = (a * 120.0) - (60.0 * (x / (t - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -5e+35) || !(t_1 <= 4e+129)) tmp = Float64(60.0 * Float64(Float64(y - x) / Float64(t - z))); else tmp = Float64(Float64(a * 120.0) - Float64(60.0 * Float64(x / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if ((t_1 <= -5e+35) || ~((t_1 <= 4e+129))) tmp = 60.0 * ((y - x) / (t - z)); else tmp = (a * 120.0) - (60.0 * (x / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+35], N[Not[LessEqual[t$95$1, 4e+129]], $MachinePrecision]], N[(60.0 * N[(N[(y - x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+35} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+129}\right):\\
\;\;\;\;60 \cdot \frac{y - x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000021e35 or 4e129 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.6%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 83.7%
if -5.00000000000000021e35 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4e129Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 86.8%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -1e+79) (not (<= (* a 120.0) 1e-84))) (* a 120.0) (* 60.0 (/ (- y x) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -1e+79) || !((a * 120.0) <= 1e-84)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((y - x) / (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a * 120.0d0) <= (-1d+79)) .or. (.not. ((a * 120.0d0) <= 1d-84))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * ((y - x) / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -1e+79) || !((a * 120.0) <= 1e-84)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((y - x) / (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -1e+79) or not ((a * 120.0) <= 1e-84): tmp = a * 120.0 else: tmp = 60.0 * ((y - x) / (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -1e+79) || !(Float64(a * 120.0) <= 1e-84)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(Float64(y - x) / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -1e+79) || ~(((a * 120.0) <= 1e-84))) tmp = a * 120.0; else tmp = 60.0 * ((y - x) / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+79], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-84]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(y - x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+79} \lor \neg \left(a \cdot 120 \leq 10^{-84}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y - x}{t - z}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999967e78 or 1e-84 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 77.9%
if -9.99999999999999967e78 < (*.f64 a #s(literal 120 binary64)) < 1e-84Initial program 98.2%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 78.9%
Final simplification78.4%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -1e+79)
(* a 120.0)
(if (<= (* a 120.0) 2e-123)
(* 60.0 (/ (- y x) (- t z)))
(+ (* a 120.0) (* -60.0 (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+79) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 2e-123) {
tmp = 60.0 * ((y - x) / (t - z));
} else {
tmp = (a * 120.0) + (-60.0 * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a * 120.0d0) <= (-1d+79)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 2d-123) then
tmp = 60.0d0 * ((y - x) / (t - z))
else
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+79) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 2e-123) {
tmp = 60.0 * ((y - x) / (t - z));
} else {
tmp = (a * 120.0) + (-60.0 * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -1e+79: tmp = a * 120.0 elif (a * 120.0) <= 2e-123: tmp = 60.0 * ((y - x) / (t - z)) else: tmp = (a * 120.0) + (-60.0 * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e+79) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 2e-123) tmp = Float64(60.0 * Float64(Float64(y - x) / Float64(t - z))); else tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -1e+79) tmp = a * 120.0; elseif ((a * 120.0) <= 2e-123) tmp = 60.0 * ((y - x) / (t - z)); else tmp = (a * 120.0) + (-60.0 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+79], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-123], N[(60.0 * N[(N[(y - x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{-123}:\\
\;\;\;\;60 \cdot \frac{y - x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999967e78Initial program 100.0%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 88.0%
if -9.99999999999999967e78 < (*.f64 a #s(literal 120 binary64)) < 2.0000000000000001e-123Initial program 98.1%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 80.5%
if 2.0000000000000001e-123 < (*.f64 a #s(literal 120 binary64)) Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 85.5%
neg-mul-185.5%
Simplified85.5%
Taylor expanded in z around inf 69.4%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.15e-35)
(* a 120.0)
(if (<= a -3.7e-207)
(* 60.0 (/ (- x y) z))
(if (<= a 7e-132) (* 60.0 (/ (- y x) t)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.15e-35) {
tmp = a * 120.0;
} else if (a <= -3.7e-207) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 7e-132) {
tmp = 60.0 * ((y - x) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.15d-35)) then
tmp = a * 120.0d0
else if (a <= (-3.7d-207)) then
tmp = 60.0d0 * ((x - y) / z)
else if (a <= 7d-132) then
tmp = 60.0d0 * ((y - x) / t)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.15e-35) {
tmp = a * 120.0;
} else if (a <= -3.7e-207) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 7e-132) {
tmp = 60.0 * ((y - x) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.15e-35: tmp = a * 120.0 elif a <= -3.7e-207: tmp = 60.0 * ((x - y) / z) elif a <= 7e-132: tmp = 60.0 * ((y - x) / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.15e-35) tmp = Float64(a * 120.0); elseif (a <= -3.7e-207) tmp = Float64(60.0 * Float64(Float64(x - y) / z)); elseif (a <= 7e-132) tmp = Float64(60.0 * Float64(Float64(y - x) / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.15e-35) tmp = a * 120.0; elseif (a <= -3.7e-207) tmp = 60.0 * ((x - y) / z); elseif (a <= 7e-132) tmp = 60.0 * ((y - x) / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.15e-35], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -3.7e-207], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e-132], N[(60.0 * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{-35}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -3.7 \cdot 10^{-207}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\mathbf{elif}\;a \leq 7 \cdot 10^{-132}:\\
\;\;\;\;60 \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -1.1499999999999999e-35 or 6.9999999999999999e-132 < a Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 68.9%
if -1.1499999999999999e-35 < a < -3.69999999999999984e-207Initial program 92.4%
associate-/l*99.7%
fma-define99.6%
Simplified99.6%
Taylor expanded in a around 0 65.7%
Taylor expanded in z around inf 55.5%
if -3.69999999999999984e-207 < a < 6.9999999999999999e-132Initial program 99.6%
associate-/l*99.7%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 91.6%
Taylor expanded in z around 0 60.0%
associate-*r/60.0%
neg-mul-160.0%
neg-sub060.0%
sub-neg60.0%
+-commutative60.0%
associate--r+60.0%
neg-sub060.0%
remove-double-neg60.0%
Simplified60.0%
Final simplification65.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.6e-176)
(* a 120.0)
(if (<= a -1.35e-233)
(* 60.0 (/ y (- z)))
(if (<= a 1.15e-132) (/ (* x (- 60.0)) t) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.6e-176) {
tmp = a * 120.0;
} else if (a <= -1.35e-233) {
tmp = 60.0 * (y / -z);
} else if (a <= 1.15e-132) {
tmp = (x * -60.0) / t;
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-5.6d-176)) then
tmp = a * 120.0d0
else if (a <= (-1.35d-233)) then
tmp = 60.0d0 * (y / -z)
else if (a <= 1.15d-132) then
tmp = (x * -60.0d0) / t
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.6e-176) {
tmp = a * 120.0;
} else if (a <= -1.35e-233) {
tmp = 60.0 * (y / -z);
} else if (a <= 1.15e-132) {
tmp = (x * -60.0) / t;
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.6e-176: tmp = a * 120.0 elif a <= -1.35e-233: tmp = 60.0 * (y / -z) elif a <= 1.15e-132: tmp = (x * -60.0) / t else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.6e-176) tmp = Float64(a * 120.0); elseif (a <= -1.35e-233) tmp = Float64(60.0 * Float64(y / Float64(-z))); elseif (a <= 1.15e-132) tmp = Float64(Float64(x * Float64(-60.0)) / t); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.6e-176) tmp = a * 120.0; elseif (a <= -1.35e-233) tmp = 60.0 * (y / -z); elseif (a <= 1.15e-132) tmp = (x * -60.0) / t; else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.6e-176], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -1.35e-233], N[(60.0 * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e-132], N[(N[(x * (-60.0)), $MachinePrecision] / t), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{-176}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -1.35 \cdot 10^{-233}:\\
\;\;\;\;60 \cdot \frac{y}{-z}\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-132}:\\
\;\;\;\;\frac{x \cdot \left(-60\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -5.6000000000000003e-176 or 1.15000000000000002e-132 < a Initial program 99.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 65.2%
if -5.6000000000000003e-176 < a < -1.35e-233Initial program 92.8%
associate-/l*99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in a around 0 88.7%
Taylor expanded in x around 0 73.6%
associate-*r/73.5%
remove-double-neg73.5%
neg-mul-173.5%
times-frac73.6%
metadata-eval73.6%
neg-sub073.6%
sub-neg73.6%
+-commutative73.6%
associate--r+73.6%
neg-sub073.6%
remove-double-neg73.6%
Simplified73.6%
Taylor expanded in t around 0 45.8%
associate-*r/45.8%
mul-1-neg45.8%
Simplified45.8%
if -1.35e-233 < a < 1.15000000000000002e-132Initial program 99.6%
associate-/l*99.7%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 90.4%
Taylor expanded in x around inf 50.2%
associate-*r/50.2%
Simplified50.2%
Taylor expanded in z around 0 40.3%
neg-mul-140.3%
Simplified40.3%
Final simplification58.3%
(FPCore (x y z t a)
:precision binary64
(if (<= x -4.8e+59)
(- (* a 120.0) (* 60.0 (/ x (- t z))))
(if (<= x 1.9e+57)
(+ (* y (/ 60.0 (- t z))) (* a 120.0))
(- (* a 120.0) (/ 60.0 (/ (- t z) x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.8e+59) {
tmp = (a * 120.0) - (60.0 * (x / (t - z)));
} else if (x <= 1.9e+57) {
tmp = (y * (60.0 / (t - z))) + (a * 120.0);
} else {
tmp = (a * 120.0) - (60.0 / ((t - 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 (x <= (-4.8d+59)) then
tmp = (a * 120.0d0) - (60.0d0 * (x / (t - z)))
else if (x <= 1.9d+57) then
tmp = (y * (60.0d0 / (t - z))) + (a * 120.0d0)
else
tmp = (a * 120.0d0) - (60.0d0 / ((t - 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 (x <= -4.8e+59) {
tmp = (a * 120.0) - (60.0 * (x / (t - z)));
} else if (x <= 1.9e+57) {
tmp = (y * (60.0 / (t - z))) + (a * 120.0);
} else {
tmp = (a * 120.0) - (60.0 / ((t - z) / x));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.8e+59: tmp = (a * 120.0) - (60.0 * (x / (t - z))) elif x <= 1.9e+57: tmp = (y * (60.0 / (t - z))) + (a * 120.0) else: tmp = (a * 120.0) - (60.0 / ((t - z) / x)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.8e+59) tmp = Float64(Float64(a * 120.0) - Float64(60.0 * Float64(x / Float64(t - z)))); elseif (x <= 1.9e+57) tmp = Float64(Float64(y * Float64(60.0 / Float64(t - z))) + Float64(a * 120.0)); else tmp = Float64(Float64(a * 120.0) - Float64(60.0 / Float64(Float64(t - z) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.8e+59) tmp = (a * 120.0) - (60.0 * (x / (t - z))); elseif (x <= 1.9e+57) tmp = (y * (60.0 / (t - z))) + (a * 120.0); else tmp = (a * 120.0) - (60.0 / ((t - z) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.8e+59], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e+57], N[(N[(y * N[(60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+59}:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t - z}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+57}:\\
\;\;\;\;y \cdot \frac{60}{t - z} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 - \frac{60}{\frac{t - z}{x}}\\
\end{array}
\end{array}
if x < -4.8000000000000004e59Initial program 98.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 87.4%
if -4.8000000000000004e59 < x < 1.8999999999999999e57Initial program 99.8%
*-commutative99.8%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 95.2%
neg-mul-195.2%
Simplified95.2%
if 1.8999999999999999e57 < x Initial program 98.1%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 86.6%
clear-num86.6%
un-div-inv86.7%
Applied egg-rr86.7%
Final simplification91.6%
(FPCore (x y z t a)
:precision binary64
(if (<= x -1.3e+59)
(- (* a 120.0) (* 60.0 (/ x (- t z))))
(if (<= x 4.8e+53)
(- (* a 120.0) (/ (* y -60.0) (- t z)))
(- (* a 120.0) (/ 60.0 (/ (- t z) x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.3e+59) {
tmp = (a * 120.0) - (60.0 * (x / (t - z)));
} else if (x <= 4.8e+53) {
tmp = (a * 120.0) - ((y * -60.0) / (t - z));
} else {
tmp = (a * 120.0) - (60.0 / ((t - 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 (x <= (-1.3d+59)) then
tmp = (a * 120.0d0) - (60.0d0 * (x / (t - z)))
else if (x <= 4.8d+53) then
tmp = (a * 120.0d0) - ((y * (-60.0d0)) / (t - z))
else
tmp = (a * 120.0d0) - (60.0d0 / ((t - 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 (x <= -1.3e+59) {
tmp = (a * 120.0) - (60.0 * (x / (t - z)));
} else if (x <= 4.8e+53) {
tmp = (a * 120.0) - ((y * -60.0) / (t - z));
} else {
tmp = (a * 120.0) - (60.0 / ((t - z) / x));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.3e+59: tmp = (a * 120.0) - (60.0 * (x / (t - z))) elif x <= 4.8e+53: tmp = (a * 120.0) - ((y * -60.0) / (t - z)) else: tmp = (a * 120.0) - (60.0 / ((t - z) / x)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.3e+59) tmp = Float64(Float64(a * 120.0) - Float64(60.0 * Float64(x / Float64(t - z)))); elseif (x <= 4.8e+53) tmp = Float64(Float64(a * 120.0) - Float64(Float64(y * -60.0) / Float64(t - z))); else tmp = Float64(Float64(a * 120.0) - Float64(60.0 / Float64(Float64(t - z) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.3e+59) tmp = (a * 120.0) - (60.0 * (x / (t - z))); elseif (x <= 4.8e+53) tmp = (a * 120.0) - ((y * -60.0) / (t - z)); else tmp = (a * 120.0) - (60.0 / ((t - z) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.3e+59], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e+53], N[(N[(a * 120.0), $MachinePrecision] - N[(N[(y * -60.0), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] - N[(60.0 / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+59}:\\
\;\;\;\;a \cdot 120 - 60 \cdot \frac{x}{t - z}\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+53}:\\
\;\;\;\;a \cdot 120 - \frac{y \cdot -60}{t - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 - \frac{60}{\frac{t - z}{x}}\\
\end{array}
\end{array}
if x < -1.3e59Initial program 98.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 87.4%
if -1.3e59 < x < 4.8e53Initial program 99.8%
Taylor expanded in x around 0 95.2%
if 4.8e53 < x Initial program 98.1%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 86.6%
clear-num86.6%
un-div-inv86.7%
Applied egg-rr86.7%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.18e-173) (not (<= a 1.15e-115))) (* a 120.0) (* 60.0 (/ y (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.18e-173) || !(a <= 1.15e-115)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.18d-173)) .or. (.not. (a <= 1.15d-115))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.18e-173) || !(a <= 1.15e-115)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.18e-173) or not (a <= 1.15e-115): tmp = a * 120.0 else: tmp = 60.0 * (y / (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.18e-173) || !(a <= 1.15e-115)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.18e-173) || ~((a <= 1.15e-115))) tmp = a * 120.0; else tmp = 60.0 * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.18e-173], N[Not[LessEqual[a, 1.15e-115]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.18 \cdot 10^{-173} \lor \neg \left(a \leq 1.15 \cdot 10^{-115}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if a < -1.1800000000000001e-173 or 1.14999999999999992e-115 < a Initial program 99.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 66.8%
if -1.1800000000000001e-173 < a < 1.14999999999999992e-115Initial program 98.4%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 89.6%
Taylor expanded in x around 0 49.4%
associate-*r/49.3%
remove-double-neg49.3%
neg-mul-149.3%
times-frac49.4%
metadata-eval49.4%
neg-sub049.4%
sub-neg49.4%
+-commutative49.4%
associate--r+49.4%
neg-sub049.4%
remove-double-neg49.4%
Simplified49.4%
Final simplification61.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.2e-207) (not (<= a 4.7e-132))) (* a 120.0) (* 60.0 (/ y t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.2e-207) || !(a <= 4.7e-132)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-4.2d-207)) .or. (.not. (a <= 4.7d-132))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.2e-207) || !(a <= 4.7e-132)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.2e-207) or not (a <= 4.7e-132): tmp = a * 120.0 else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.2e-207) || !(a <= 4.7e-132)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.2e-207) || ~((a <= 4.7e-132))) tmp = a * 120.0; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.2e-207], N[Not[LessEqual[a, 4.7e-132]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-207} \lor \neg \left(a \leq 4.7 \cdot 10^{-132}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -4.20000000000000007e-207 or 4.7000000000000002e-132 < a Initial program 98.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 64.1%
if -4.20000000000000007e-207 < a < 4.7000000000000002e-132Initial program 99.6%
associate-/l*99.7%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 91.6%
Taylor expanded in x around 0 49.4%
associate-*r/49.4%
remove-double-neg49.4%
neg-mul-149.4%
times-frac49.4%
metadata-eval49.4%
neg-sub049.4%
sub-neg49.4%
+-commutative49.4%
associate--r+49.4%
neg-sub049.4%
remove-double-neg49.4%
Simplified49.4%
Taylor expanded in t around inf 28.0%
Final simplification54.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -6.2e+201) (* 60.0 (/ y (- z))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6.2e+201) {
tmp = 60.0 * (y / -z);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-6.2d+201)) then
tmp = 60.0d0 * (y / -z)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6.2e+201) {
tmp = 60.0 * (y / -z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -6.2e+201: tmp = 60.0 * (y / -z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -6.2e+201) tmp = Float64(60.0 * Float64(y / Float64(-z))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -6.2e+201) tmp = 60.0 * (y / -z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -6.2e+201], N[(60.0 * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+201}:\\
\;\;\;\;60 \cdot \frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -6.19999999999999961e201Initial program 96.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 85.6%
Taylor expanded in x around 0 78.0%
associate-*r/74.2%
remove-double-neg74.2%
neg-mul-174.2%
times-frac78.0%
metadata-eval78.0%
neg-sub078.0%
sub-neg78.0%
+-commutative78.0%
associate--r+78.0%
neg-sub078.0%
remove-double-neg78.0%
Simplified78.0%
Taylor expanded in t around 0 52.0%
associate-*r/52.0%
mul-1-neg52.0%
Simplified52.0%
if -6.19999999999999961e201 < y Initial program 99.4%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around inf 53.6%
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.0%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in z around inf 50.0%
Final simplification50.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 2024146
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))