
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ 60.0 (- z t)) (- x y) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return fma((60.0 / (z - t)), (x - y), (a * 120.0));
}
function code(x, y, z, t, a) return fma(Float64(60.0 / Float64(z - t)), Float64(x - y), Float64(a * 120.0)) end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{60}{z - t}, x - y, a \cdot 120\right)
\end{array}
Initial program 99.4%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/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 (- x y)) (- z t)))) (if (<= t_1 -2e+30) t_1 (if (<= t_1 0.02) (* a 120.0) t_1))))
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 <= -2e+30) {
tmp = t_1;
} else if (t_1 <= 0.02) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-2d+30)) then
tmp = t_1
else if (t_1 <= 0.02d0) then
tmp = a * 120.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+30) {
tmp = t_1;
} else if (t_1 <= 0.02) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+30: tmp = t_1 elif t_1 <= 0.02: tmp = a * 120.0 else: tmp = t_1 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 <= -2e+30) tmp = t_1; elseif (t_1 <= 0.02) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -2e+30) tmp = t_1; elseif (t_1 <= 0.02) tmp = 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[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+30], t$95$1, If[LessEqual[t$95$1, 0.02], N[(a * 120.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0.02:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e30 or 0.0200000000000000004 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.0%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6477.0
Simplified77.0%
if -2e30 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 0.0200000000000000004Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f6475.4
Simplified75.4%
Final simplification76.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= y -5e+156)
t_1
(if (<= y 5.2e+154) (fma 120.0 a (* (/ 60.0 (- z t)) x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (y <= -5e+156) {
tmp = t_1;
} else if (y <= 5.2e+154) {
tmp = fma(120.0, a, ((60.0 / (z - t)) * x));
} else {
tmp = t_1;
}
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 (y <= -5e+156) tmp = t_1; elseif (y <= 5.2e+154) tmp = fma(120.0, a, Float64(Float64(60.0 / Float64(z - t)) * x)); else tmp = t_1; end return 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[LessEqual[y, -5e+156], t$95$1, If[LessEqual[y, 5.2e+154], N[(120.0 * a + N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;y \leq -5 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(120, a, \frac{60}{z - t} \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.99999999999999992e156 or 5.19999999999999978e154 < y Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6478.3
Simplified78.3%
if -4.99999999999999992e156 < y < 5.19999999999999978e154Initial program 99.3%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6490.8
Simplified90.8%
Final simplification87.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ (- x y) z) (* a 120.0))))
(if (<= z -2.2e-22)
t_1
(if (<= z 400000000000.0) (fma -60.0 (/ (- x y) t) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(60.0, ((x - y) / z), (a * 120.0));
double tmp;
if (z <= -2.2e-22) {
tmp = t_1;
} else if (z <= 400000000000.0) {
tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0)) tmp = 0.0 if (z <= -2.2e-22) tmp = t_1; elseif (z <= 400000000000.0) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e-22], t$95$1, If[LessEqual[z, 400000000000.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 400000000000:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2000000000000001e-22 or 4e11 < z Initial program 99.2%
Taylor expanded in z around inf
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6489.4
Simplified89.4%
if -2.2000000000000001e-22 < z < 4e11Initial program 99.8%
Taylor expanded in z around 0
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6482.4
Simplified82.4%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 120.0 a (/ (* 60.0 x) z))))
(if (<= z -1.5e-24)
t_1
(if (<= z 430000000000.0) (fma -60.0 (/ (- x y) t) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(120.0, a, ((60.0 * x) / z));
double tmp;
if (z <= -1.5e-24) {
tmp = t_1;
} else if (z <= 430000000000.0) {
tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(120.0, a, Float64(Float64(60.0 * x) / z)) tmp = 0.0 if (z <= -1.5e-24) tmp = t_1; elseif (z <= 430000000000.0) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(120.0 * a + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e-24], t$95$1, If[LessEqual[z, 430000000000.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 430000000000:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.49999999999999998e-24 or 4.3e11 < z Initial program 99.2%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6480.0
Simplified80.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6474.9
Simplified74.9%
if -1.49999999999999998e-24 < z < 4.3e11Initial program 99.8%
Taylor expanded in z around 0
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6482.4
Simplified82.4%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.8e-127)
(* a 120.0)
(if (<= a -1.3e-302)
(* x (/ -60.0 t))
(if (<= a 4.3e-120) (/ x (* z 0.016666666666666666)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.8e-127) {
tmp = a * 120.0;
} else if (a <= -1.3e-302) {
tmp = x * (-60.0 / t);
} else if (a <= 4.3e-120) {
tmp = x / (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 <= (-4.8d-127)) then
tmp = a * 120.0d0
else if (a <= (-1.3d-302)) then
tmp = x * ((-60.0d0) / t)
else if (a <= 4.3d-120) then
tmp = x / (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 <= -4.8e-127) {
tmp = a * 120.0;
} else if (a <= -1.3e-302) {
tmp = x * (-60.0 / t);
} else if (a <= 4.3e-120) {
tmp = x / (z * 0.016666666666666666);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.8e-127: tmp = a * 120.0 elif a <= -1.3e-302: tmp = x * (-60.0 / t) elif a <= 4.3e-120: tmp = x / (z * 0.016666666666666666) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.8e-127) tmp = Float64(a * 120.0); elseif (a <= -1.3e-302) tmp = Float64(x * Float64(-60.0 / t)); elseif (a <= 4.3e-120) tmp = Float64(x / Float64(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 <= -4.8e-127) tmp = a * 120.0; elseif (a <= -1.3e-302) tmp = x * (-60.0 / t); elseif (a <= 4.3e-120) tmp = x / (z * 0.016666666666666666); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.8e-127], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -1.3e-302], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.3e-120], N[(x / N[(z * 0.016666666666666666), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-127}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-302}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\mathbf{elif}\;a \leq 4.3 \cdot 10^{-120}:\\
\;\;\;\;\frac{x}{z \cdot 0.016666666666666666}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -4.79999999999999964e-127 or 4.29999999999999982e-120 < a Initial program 99.3%
Taylor expanded in z around inf
*-lowering-*.f6464.4
Simplified64.4%
if -4.79999999999999964e-127 < a < -1.30000000000000006e-302Initial program 99.8%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6451.6
Simplified51.6%
Taylor expanded in z around 0
/-lowering-/.f6439.1
Simplified39.1%
if -1.30000000000000006e-302 < a < 4.29999999999999982e-120Initial program 99.7%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6450.6
Simplified50.6%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6441.4
Simplified41.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
div-invN/A
metadata-evalN/A
*-lowering-*.f6441.4
Applied egg-rr41.4%
Final simplification57.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.8e-127)
(* a 120.0)
(if (<= a -8.5e-307)
(* x (/ -60.0 t))
(if (<= a 2.9e-120) (* x (/ 60.0 z)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e-127) {
tmp = a * 120.0;
} else if (a <= -8.5e-307) {
tmp = x * (-60.0 / t);
} else if (a <= 2.9e-120) {
tmp = x * (60.0 / 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 (a <= (-3.8d-127)) then
tmp = a * 120.0d0
else if (a <= (-8.5d-307)) then
tmp = x * ((-60.0d0) / t)
else if (a <= 2.9d-120) then
tmp = x * (60.0d0 / 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 (a <= -3.8e-127) {
tmp = a * 120.0;
} else if (a <= -8.5e-307) {
tmp = x * (-60.0 / t);
} else if (a <= 2.9e-120) {
tmp = x * (60.0 / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.8e-127: tmp = a * 120.0 elif a <= -8.5e-307: tmp = x * (-60.0 / t) elif a <= 2.9e-120: tmp = x * (60.0 / z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.8e-127) tmp = Float64(a * 120.0); elseif (a <= -8.5e-307) tmp = Float64(x * Float64(-60.0 / t)); elseif (a <= 2.9e-120) tmp = Float64(x * Float64(60.0 / z)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.8e-127) tmp = a * 120.0; elseif (a <= -8.5e-307) tmp = x * (-60.0 / t); elseif (a <= 2.9e-120) tmp = x * (60.0 / z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.8e-127], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -8.5e-307], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e-120], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-127}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -8.5 \cdot 10^{-307}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{-120}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -3.80000000000000003e-127 or 2.9e-120 < a Initial program 99.3%
Taylor expanded in z around inf
*-lowering-*.f6464.4
Simplified64.4%
if -3.80000000000000003e-127 < a < -8.4999999999999995e-307Initial program 99.8%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6451.6
Simplified51.6%
Taylor expanded in z around 0
/-lowering-/.f6439.1
Simplified39.1%
if -8.4999999999999995e-307 < a < 2.9e-120Initial program 99.7%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6450.6
Simplified50.6%
Taylor expanded in z around inf
/-lowering-/.f6441.4
Simplified41.4%
Final simplification57.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.1e-45) (fma 120.0 a (/ (* 60.0 x) z)) (if (<= a 2.8e-17) (/ (* 60.0 (- x y)) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.1e-45) {
tmp = fma(120.0, a, ((60.0 * x) / z));
} else if (a <= 2.8e-17) {
tmp = (60.0 * (x - y)) / (z - t);
} else {
tmp = a * 120.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.1e-45) tmp = fma(120.0, a, Float64(Float64(60.0 * x) / z)); elseif (a <= 2.8e-17) tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)); else tmp = Float64(a * 120.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.1e-45], N[(120.0 * a + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-17], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.1 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -5.0999999999999997e-45Initial program 98.4%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6481.3
Simplified81.3%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6466.8
Simplified66.8%
if -5.0999999999999997e-45 < a < 2.7999999999999999e-17Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6480.3
Simplified80.3%
if 2.7999999999999999e-17 < a Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f6479.6
Simplified79.6%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.45e+155) (* -60.0 (/ y (- z t))) (if (<= y 2e+142) (* a 120.0) (/ (* y -60.0) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.45e+155) {
tmp = -60.0 * (y / (z - t));
} else if (y <= 2e+142) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / (z - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.45d+155)) then
tmp = (-60.0d0) * (y / (z - t))
else if (y <= 2d+142) then
tmp = a * 120.0d0
else
tmp = (y * (-60.0d0)) / (z - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.45e+155) {
tmp = -60.0 * (y / (z - t));
} else if (y <= 2e+142) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / (z - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.45e+155: tmp = -60.0 * (y / (z - t)) elif y <= 2e+142: tmp = a * 120.0 else: tmp = (y * -60.0) / (z - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.45e+155) tmp = Float64(-60.0 * Float64(y / Float64(z - t))); elseif (y <= 2e+142) tmp = Float64(a * 120.0); else tmp = Float64(Float64(y * -60.0) / Float64(z - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.45e+155) tmp = -60.0 * (y / (z - t)); elseif (y <= 2e+142) tmp = a * 120.0; else tmp = (y * -60.0) / (z - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.45e+155], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+142], N[(a * 120.0), $MachinePrecision], N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+155}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+142}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z - t}\\
\end{array}
\end{array}
if y < -1.45e155Initial program 99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6464.3
Simplified64.3%
if -1.45e155 < y < 2.0000000000000001e142Initial program 99.3%
Taylor expanded in z around inf
*-lowering-*.f6460.3
Simplified60.3%
if 2.0000000000000001e142 < y Initial program 99.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.4
Applied egg-rr99.4%
Taylor expanded in y around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6470.7
Simplified70.7%
Final simplification62.2%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.6e+160) (* -60.0 (/ y (- z t))) (if (<= y 1.9e+143) (* a 120.0) (* y (/ 60.0 (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e+160) {
tmp = -60.0 * (y / (z - t));
} else if (y <= 1.9e+143) {
tmp = a * 120.0;
} else {
tmp = y * (60.0 / (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 (y <= (-4.6d+160)) then
tmp = (-60.0d0) * (y / (z - t))
else if (y <= 1.9d+143) then
tmp = a * 120.0d0
else
tmp = y * (60.0d0 / (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 (y <= -4.6e+160) {
tmp = -60.0 * (y / (z - t));
} else if (y <= 1.9e+143) {
tmp = a * 120.0;
} else {
tmp = y * (60.0 / (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.6e+160: tmp = -60.0 * (y / (z - t)) elif y <= 1.9e+143: tmp = a * 120.0 else: tmp = y * (60.0 / (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.6e+160) tmp = Float64(-60.0 * Float64(y / Float64(z - t))); elseif (y <= 1.9e+143) tmp = Float64(a * 120.0); else tmp = Float64(y * Float64(60.0 / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.6e+160) tmp = -60.0 * (y / (z - t)); elseif (y <= 1.9e+143) tmp = a * 120.0; else tmp = y * (60.0 / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.6e+160], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+143], N[(a * 120.0), $MachinePrecision], N[(y * N[(60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+160}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+143}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{60}{t - z}\\
\end{array}
\end{array}
if y < -4.59999999999999975e160Initial program 99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6464.3
Simplified64.3%
if -4.59999999999999975e160 < y < 1.9e143Initial program 99.3%
Taylor expanded in z around inf
*-lowering-*.f6460.3
Simplified60.3%
if 1.9e143 < y Initial program 99.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.4
Applied egg-rr99.4%
Taylor expanded in y around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6470.7
Simplified70.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
frac-2negN/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6470.6
Applied egg-rr70.6%
Final simplification62.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ y (- z t))))) (if (<= y -1.7e+157) t_1 (if (<= y 1.82e+142) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -1.7e+157) {
tmp = t_1;
} else if (y <= 1.82e+142) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (-60.0d0) * (y / (z - t))
if (y <= (-1.7d+157)) then
tmp = t_1
else if (y <= 1.82d+142) then
tmp = a * 120.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -1.7e+157) {
tmp = t_1;
} else if (y <= 1.82e+142) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) tmp = 0 if y <= -1.7e+157: tmp = t_1 elif y <= 1.82e+142: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -1.7e+157) tmp = t_1; elseif (y <= 1.82e+142) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (y / (z - t)); tmp = 0.0; if (y <= -1.7e+157) tmp = t_1; elseif (y <= 1.82e+142) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+157], t$95$1, If[LessEqual[y, 1.82e+142], N[(a * 120.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.82 \cdot 10^{+142}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.6999999999999999e157 or 1.8200000000000001e142 < y Initial program 99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6467.2
Simplified67.2%
if -1.6999999999999999e157 < y < 1.8200000000000001e142Initial program 99.3%
Taylor expanded in z around inf
*-lowering-*.f6460.3
Simplified60.3%
Final simplification62.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -6e-128) (* a 120.0) (if (<= a 3.2e-204) (* x (/ -60.0 t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e-128) {
tmp = a * 120.0;
} else if (a <= 3.2e-204) {
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 <= (-6d-128)) then
tmp = a * 120.0d0
else if (a <= 3.2d-204) 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 <= -6e-128) {
tmp = a * 120.0;
} else if (a <= 3.2e-204) {
tmp = x * (-60.0 / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e-128: tmp = a * 120.0 elif a <= 3.2e-204: tmp = x * (-60.0 / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e-128) tmp = Float64(a * 120.0); elseif (a <= 3.2e-204) tmp = 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 <= -6e-128) tmp = a * 120.0; elseif (a <= 3.2e-204) tmp = x * (-60.0 / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e-128], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, 3.2e-204], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-128}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{-204}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -5.99999999999999956e-128 or 3.2e-204 < a Initial program 99.4%
Taylor expanded in z around inf
*-lowering-*.f6460.4
Simplified60.4%
if -5.99999999999999956e-128 < a < 3.2e-204Initial program 99.7%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f6452.6
Simplified52.6%
Taylor expanded in z around 0
/-lowering-/.f6435.6
Simplified35.6%
Final simplification54.9%
(FPCore (x y z t a) :precision binary64 (if (<= y 1.32e+215) (* a 120.0) (* 60.0 (/ y t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.32e+215) {
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 (y <= 1.32d+215) 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 (y <= 1.32e+215) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 1.32e+215: tmp = a * 120.0 else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.32e+215) 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 (y <= 1.32e+215) tmp = a * 120.0; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.32e+215], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.32 \cdot 10^{+215}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < 1.32000000000000005e215Initial program 99.4%
Taylor expanded in z around inf
*-lowering-*.f6452.8
Simplified52.8%
if 1.32000000000000005e215 < y Initial program 99.9%
Taylor expanded in z around 0
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6436.7
Simplified36.7%
Taylor expanded in y around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6437.6
Simplified37.6%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6437.4
Applied egg-rr37.4%
Final simplification51.8%
(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.4%
Taylor expanded in z around inf
*-lowering-*.f6449.9
Simplified49.9%
Final simplification49.9%
(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 2024197
(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)))