
(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 (- z t)) (- x y)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 / (z - t)) * (x - y)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 / (z - t)) * (x - y)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 / (z - t)) * (x - y)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 / (z - t)) * (x - y)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 / (z - t)) * (x - y)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{z - t} \cdot \left(x - y\right) + a \cdot 120
\end{array}
Initial program 99.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ 60.0 (- z t))) (t_2 (+ (* t_1 x) (* a 120.0))))
(if (<= (* a 120.0) -4e-38)
t_2
(if (<= (* a 120.0) 2e-122) (* t_1 (- x y)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 / (z - t);
double t_2 = (t_1 * x) + (a * 120.0);
double tmp;
if ((a * 120.0) <= -4e-38) {
tmp = t_2;
} else if ((a * 120.0) <= 2e-122) {
tmp = t_1 * (x - y);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 60.0d0 / (z - t)
t_2 = (t_1 * x) + (a * 120.0d0)
if ((a * 120.0d0) <= (-4d-38)) then
tmp = t_2
else if ((a * 120.0d0) <= 2d-122) then
tmp = t_1 * (x - y)
else
tmp = t_2
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 / (z - t);
double t_2 = (t_1 * x) + (a * 120.0);
double tmp;
if ((a * 120.0) <= -4e-38) {
tmp = t_2;
} else if ((a * 120.0) <= 2e-122) {
tmp = t_1 * (x - y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 / (z - t) t_2 = (t_1 * x) + (a * 120.0) tmp = 0 if (a * 120.0) <= -4e-38: tmp = t_2 elif (a * 120.0) <= 2e-122: tmp = t_1 * (x - y) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 / Float64(z - t)) t_2 = Float64(Float64(t_1 * x) + Float64(a * 120.0)) tmp = 0.0 if (Float64(a * 120.0) <= -4e-38) tmp = t_2; elseif (Float64(a * 120.0) <= 2e-122) tmp = Float64(t_1 * Float64(x - y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 / (z - t); t_2 = (t_1 * x) + (a * 120.0); tmp = 0.0; if ((a * 120.0) <= -4e-38) tmp = t_2; elseif ((a * 120.0) <= 2e-122) tmp = t_1 * (x - y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * x), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 120.0), $MachinePrecision], -4e-38], t$95$2, If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-122], N[(t$95$1 * N[(x - y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60}{z - t}\\
t_2 := t\_1 \cdot x + a \cdot 120\\
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{-38}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{-122}:\\
\;\;\;\;t\_1 \cdot \left(x - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -3.9999999999999998e-38 or 2.00000000000000012e-122 < (*.f64 a #s(literal 120 binary64)) Initial program 99.8%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
Simplified88.4%
if -3.9999999999999998e-38 < (*.f64 a #s(literal 120 binary64)) < 2.00000000000000012e-122Initial program 99.6%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6486.0%
Simplified86.0%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6486.1%
Applied egg-rr86.1%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -1e+14) (* a 120.0) (if (<= (* a 120.0) 1e-7) (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+14) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-7) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a * 120.0d0) <= (-1d+14)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 1d-7) then
tmp = 60.0d0 / ((z - t) / (x - y))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+14) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-7) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -1e+14: tmp = a * 120.0 elif (a * 120.0) <= 1e-7: tmp = 60.0 / ((z - t) / (x - y)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e+14) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 1e-7) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -1e+14) tmp = a * 120.0; elseif ((a * 120.0) <= 1e-7) tmp = 60.0 / ((z - t) / (x - y)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+14], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-7], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+14}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-7}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1e14 or 9.9999999999999995e-8 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f6479.1%
Simplified79.1%
if -1e14 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999995e-8Initial program 99.6%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6479.6%
Simplified79.6%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6479.7%
Applied egg-rr79.7%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -1e+14) (* a 120.0) (if (<= (* a 120.0) 1e-25) (* (/ 60.0 (- z t)) (- x y)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+14) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-25) {
tmp = (60.0 / (z - t)) * (x - y);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a * 120.0d0) <= (-1d+14)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 1d-25) then
tmp = (60.0d0 / (z - t)) * (x - y)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+14) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-25) {
tmp = (60.0 / (z - t)) * (x - y);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -1e+14: tmp = a * 120.0 elif (a * 120.0) <= 1e-25: tmp = (60.0 / (z - t)) * (x - y) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e+14) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 1e-25) tmp = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -1e+14) tmp = a * 120.0; elseif ((a * 120.0) <= 1e-25) tmp = (60.0 / (z - t)) * (x - y); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+14], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-25], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+14}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-25}:\\
\;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1e14 or 1.00000000000000004e-25 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f6478.7%
Simplified78.7%
if -1e14 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000004e-25Initial program 99.6%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6480.0%
Simplified80.0%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6480.1%
Applied egg-rr80.1%
Final simplification79.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (/ 60.0 (/ (- t z) y)) (* a 120.0))))
(if (<= y -6e+72)
t_1
(if (<= y 2.65e+82) (+ (* (/ 60.0 (- z t)) x) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 / ((t - z) / y)) + (a * 120.0);
double tmp;
if (y <= -6e+72) {
tmp = t_1;
} else if (y <= 2.65e+82) {
tmp = ((60.0 / (z - t)) * x) + (a * 120.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 / ((t - z) / y)) + (a * 120.0d0)
if (y <= (-6d+72)) then
tmp = t_1
else if (y <= 2.65d+82) then
tmp = ((60.0d0 / (z - t)) * x) + (a * 120.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 / ((t - z) / y)) + (a * 120.0);
double tmp;
if (y <= -6e+72) {
tmp = t_1;
} else if (y <= 2.65e+82) {
tmp = ((60.0 / (z - t)) * x) + (a * 120.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 / ((t - z) / y)) + (a * 120.0) tmp = 0 if y <= -6e+72: tmp = t_1 elif y <= 2.65e+82: tmp = ((60.0 / (z - t)) * x) + (a * 120.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 / Float64(Float64(t - z) / y)) + Float64(a * 120.0)) tmp = 0.0 if (y <= -6e+72) tmp = t_1; elseif (y <= 2.65e+82) tmp = Float64(Float64(Float64(60.0 / Float64(z - t)) * x) + Float64(a * 120.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 / ((t - z) / y)) + (a * 120.0); tmp = 0.0; if (y <= -6e+72) tmp = t_1; elseif (y <= 2.65e+82) tmp = ((60.0 / (z - t)) * x) + (a * 120.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+72], t$95$1, If[LessEqual[y, 2.65e+82], N[(N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60}{\frac{t - z}{y}} + a \cdot 120\\
\mathbf{if}\;y \leq -6 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{+82}:\\
\;\;\;\;\frac{60}{z - t} \cdot x + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.00000000000000006e72 or 2.64999999999999989e82 < y Initial program 99.7%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around 0
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6492.4%
Simplified92.4%
if -6.00000000000000006e72 < y < 2.64999999999999989e82Initial program 99.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
Simplified91.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.35e-48) (* a 120.0) (if (<= a 5.5e-26) (/ (* (- x y) -60.0) t) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.35e-48) {
tmp = a * 120.0;
} else if (a <= 5.5e-26) {
tmp = ((x - y) * -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 <= (-1.35d-48)) then
tmp = a * 120.0d0
else if (a <= 5.5d-26) then
tmp = ((x - y) * (-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 <= -1.35e-48) {
tmp = a * 120.0;
} else if (a <= 5.5e-26) {
tmp = ((x - y) * -60.0) / t;
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.35e-48: tmp = a * 120.0 elif a <= 5.5e-26: tmp = ((x - y) * -60.0) / t else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.35e-48) tmp = Float64(a * 120.0); elseif (a <= 5.5e-26) tmp = Float64(Float64(Float64(x - y) * -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 <= -1.35e-48) tmp = a * 120.0; elseif (a <= 5.5e-26) tmp = ((x - y) * -60.0) / t; else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.35e-48], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 5.5e-26], N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{-48}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -1.35000000000000006e-48 or 5.5000000000000005e-26 < a Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f6476.0%
Simplified76.0%
if -1.35000000000000006e-48 < a < 5.5000000000000005e-26Initial program 99.6%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6483.7%
Simplified83.7%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6451.2%
Simplified51.2%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.26e-51) (* a 120.0) (if (<= a 3.1e-43) (/ x (* (- t z) -0.016666666666666666)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.26e-51) {
tmp = a * 120.0;
} else if (a <= 3.1e-43) {
tmp = x / ((t - z) * -0.016666666666666666);
} 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.26d-51)) then
tmp = a * 120.0d0
else if (a <= 3.1d-43) then
tmp = x / ((t - z) * (-0.016666666666666666d0))
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.26e-51) {
tmp = a * 120.0;
} else if (a <= 3.1e-43) {
tmp = x / ((t - z) * -0.016666666666666666);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.26e-51: tmp = a * 120.0 elif a <= 3.1e-43: tmp = x / ((t - z) * -0.016666666666666666) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.26e-51) tmp = Float64(a * 120.0); elseif (a <= 3.1e-43) tmp = Float64(x / Float64(Float64(t - z) * -0.016666666666666666)); 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.26e-51) tmp = a * 120.0; elseif (a <= 3.1e-43) tmp = x / ((t - z) * -0.016666666666666666); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.26e-51], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 3.1e-43], N[(x / N[(N[(t - z), $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.26 \cdot 10^{-51}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot -0.016666666666666666}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -1.2600000000000001e-51 or 3.0999999999999999e-43 < a Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f6474.4%
Simplified74.4%
if -1.2600000000000001e-51 < a < 3.0999999999999999e-43Initial program 99.6%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.5%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6449.2%
Simplified49.2%
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6449.2%
Applied egg-rr49.2%
Final simplification64.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.4e-50) (* a 120.0) (if (<= a 7.2e-43) (* (/ 60.0 (- z t)) x) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.4e-50) {
tmp = a * 120.0;
} else if (a <= 7.2e-43) {
tmp = (60.0 / (z - t)) * x;
} 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.4d-50)) then
tmp = a * 120.0d0
else if (a <= 7.2d-43) then
tmp = (60.0d0 / (z - t)) * x
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.4e-50) {
tmp = a * 120.0;
} else if (a <= 7.2e-43) {
tmp = (60.0 / (z - t)) * x;
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.4e-50: tmp = a * 120.0 elif a <= 7.2e-43: tmp = (60.0 / (z - t)) * x else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.4e-50) tmp = Float64(a * 120.0); elseif (a <= 7.2e-43) tmp = Float64(Float64(60.0 / Float64(z - t)) * x); 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.4e-50) tmp = a * 120.0; elseif (a <= 7.2e-43) tmp = (60.0 / (z - t)) * x; else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.4e-50], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 7.2e-43], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{-50}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{60}{z - t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -1.3999999999999999e-50 or 7.1999999999999998e-43 < a Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f6474.4%
Simplified74.4%
if -1.3999999999999999e-50 < a < 7.1999999999999998e-43Initial program 99.6%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6449.1%
Simplified49.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6449.2%
Applied egg-rr49.2%
Final simplification64.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e-42) (* a 120.0) (if (<= a 2.9e-24) (* -60.0 (/ y (- z t))) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e-42) {
tmp = a * 120.0;
} else if (a <= 2.9e-24) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-4.2d-42)) then
tmp = a * 120.0d0
else if (a <= 2.9d-24) then
tmp = (-60.0d0) * (y / (z - t))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e-42) {
tmp = a * 120.0;
} else if (a <= 2.9e-24) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.2e-42: tmp = a * 120.0 elif a <= 2.9e-24: tmp = -60.0 * (y / (z - t)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e-42) tmp = Float64(a * 120.0); elseif (a <= 2.9e-24) tmp = Float64(-60.0 * Float64(y / Float64(z - t))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.2e-42) tmp = a * 120.0; elseif (a <= 2.9e-24) tmp = -60.0 * (y / (z - t)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e-42], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 2.9e-24], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-42}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{-24}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -4.20000000000000013e-42 or 2.8999999999999999e-24 < a Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f6476.4%
Simplified76.4%
if -4.20000000000000013e-42 < a < 2.8999999999999999e-24Initial program 99.6%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6439.9%
Simplified39.9%
Final simplification60.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.9e-169) (* a 120.0) (if (<= a 6.2e-44) (/ x (* t -0.016666666666666666)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.9e-169) {
tmp = a * 120.0;
} else if (a <= 6.2e-44) {
tmp = x / (t * -0.016666666666666666);
} 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.9d-169)) then
tmp = a * 120.0d0
else if (a <= 6.2d-44) then
tmp = x / (t * (-0.016666666666666666d0))
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.9e-169) {
tmp = a * 120.0;
} else if (a <= 6.2e-44) {
tmp = x / (t * -0.016666666666666666);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.9e-169: tmp = a * 120.0 elif a <= 6.2e-44: tmp = x / (t * -0.016666666666666666) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.9e-169) tmp = Float64(a * 120.0); elseif (a <= 6.2e-44) tmp = Float64(x / Float64(t * -0.016666666666666666)); 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.9e-169) tmp = a * 120.0; elseif (a <= 6.2e-44) tmp = x / (t * -0.016666666666666666); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.9e-169], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 6.2e-44], N[(x / N[(t * -0.016666666666666666), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-169}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{t \cdot -0.016666666666666666}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -1.9e-169 or 6.19999999999999968e-44 < a Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f6469.1%
Simplified69.1%
if -1.9e-169 < a < 6.19999999999999968e-44Initial program 99.5%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.4%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6450.9%
Simplified50.9%
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6451.0%
Applied egg-rr51.0%
Taylor expanded in t around inf
*-commutativeN/A
*-lowering-*.f6432.3%
Simplified32.3%
Final simplification56.9%
(FPCore (x y z t a) :precision binary64 (if (<= x 1.02e+198) (* a 120.0) (* x (/ 60.0 z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 1.02e+198) {
tmp = a * 120.0;
} else {
tmp = x * (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 (x <= 1.02d+198) then
tmp = a * 120.0d0
else
tmp = x * (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 (x <= 1.02e+198) {
tmp = a * 120.0;
} else {
tmp = x * (60.0 / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= 1.02e+198: tmp = a * 120.0 else: tmp = x * (60.0 / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= 1.02e+198) tmp = Float64(a * 120.0); else tmp = Float64(x * Float64(60.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= 1.02e+198) tmp = a * 120.0; else tmp = x * (60.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, 1.02e+198], N[(a * 120.0), $MachinePrecision], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.02 \cdot 10^{+198}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\end{array}
\end{array}
if x < 1.01999999999999998e198Initial program 99.7%
Taylor expanded in z around inf
*-lowering-*.f6455.1%
Simplified55.1%
if 1.01999999999999998e198 < x Initial program 99.6%
flip3-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip3-+N/A
Applied egg-rr99.3%
Taylor expanded in x around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6469.4%
Simplified69.4%
clear-numN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6469.4%
Applied egg-rr69.4%
Taylor expanded in t around 0
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6445.8%
Simplified45.8%
Final simplification54.1%
(FPCore (x y z t a) :precision binary64 (* a 120.0))
double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = a * 120.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
def code(x, y, z, t, a): return a * 120.0
function code(x, y, z, t, a) return Float64(a * 120.0) end
function tmp = code(x, y, z, t, a) tmp = a * 120.0; end
code[x_, y_, z_, t_, a_] := N[(a * 120.0), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120
\end{array}
Initial program 99.7%
Taylor expanded in z around inf
*-lowering-*.f6451.6%
Simplified51.6%
Final simplification51.6%
(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 2024192
(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)))