
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
Initial program 99.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (- x y))) (t_2 (/ t_1 z)) (t_3 (/ t_1 (- z t)))) (if (<= t_3 -5e-11) t_2 (if (<= t_3 1e+41) (* a 120.0) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (x - y);
double t_2 = t_1 / z;
double t_3 = t_1 / (z - t);
double tmp;
if (t_3 <= -5e-11) {
tmp = t_2;
} else if (t_3 <= 1e+41) {
tmp = a * 120.0;
} 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) :: t_3
real(8) :: tmp
t_1 = 60.0d0 * (x - y)
t_2 = t_1 / z
t_3 = t_1 / (z - t)
if (t_3 <= (-5d-11)) then
tmp = t_2
else if (t_3 <= 1d+41) then
tmp = a * 120.0d0
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 * (x - y);
double t_2 = t_1 / z;
double t_3 = t_1 / (z - t);
double tmp;
if (t_3 <= -5e-11) {
tmp = t_2;
} else if (t_3 <= 1e+41) {
tmp = a * 120.0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (x - y) t_2 = t_1 / z t_3 = t_1 / (z - t) tmp = 0 if t_3 <= -5e-11: tmp = t_2 elif t_3 <= 1e+41: tmp = a * 120.0 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(x - y)) t_2 = Float64(t_1 / z) t_3 = Float64(t_1 / Float64(z - t)) tmp = 0.0 if (t_3 <= -5e-11) tmp = t_2; elseif (t_3 <= 1e+41) tmp = Float64(a * 120.0); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * (x - y); t_2 = t_1 / z; t_3 = t_1 / (z - t); tmp = 0.0; if (t_3 <= -5e-11) tmp = t_2; elseif (t_3 <= 1e+41) tmp = a * 120.0; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / z), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-11], t$95$2, If[LessEqual[t$95$3, 1e+41], N[(a * 120.0), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \left(x - y\right)\\
t_2 := \frac{t\_1}{z}\\
t_3 := \frac{t\_1}{z - t}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-11}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 10^{+41}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000018e-11 or 1.00000000000000001e41 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.0%
Taylor expanded in z around inf
lower-*.f6420.2
Applied rewrites20.2%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6481.1
Applied rewrites81.1%
Taylor expanded in z around inf
Applied rewrites50.1%
if -5.00000000000000018e-11 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000001e41Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6474.2
Applied rewrites74.2%
Final simplification61.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ (- x y) t) (* a 120.0))))
(if (<= (* a 120.0) -1e+29)
t_1
(if (<= (* a 120.0) 5e-31)
(/ (- x y) (* (- z t) 0.016666666666666666))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, ((x - y) / t), (a * 120.0));
double tmp;
if ((a * 120.0) <= -1e+29) {
tmp = t_1;
} else if ((a * 120.0) <= 5e-31) {
tmp = (x - y) / ((z - t) * 0.016666666666666666);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0)) tmp = 0.0 if (Float64(a * 120.0) <= -1e+29) tmp = t_1; elseif (Float64(a * 120.0) <= 5e-31) tmp = Float64(Float64(x - y) / Float64(Float64(z - t) * 0.016666666666666666)); 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] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+29], t$95$1, If[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-31], N[(N[(x - y), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{-31}:\\
\;\;\;\;\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999914e28 or 5e-31 < (*.f64 a #s(literal 120 binary64)) Initial program 99.1%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6479.3
Applied rewrites79.3%
if -9.99999999999999914e28 < (*.f64 a #s(literal 120 binary64)) < 5e-31Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6420.9
Applied rewrites20.9%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6481.3
Applied rewrites81.3%
Applied rewrites81.3%
Final simplification80.4%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -5e+61)
(fma y (/ 60.0 t) (* a 120.0))
(if (<= (* a 120.0) 1e-26)
(/ (- x y) (* (- z t) 0.016666666666666666))
(fma -60.0 (/ y z) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e+61) {
tmp = fma(y, (60.0 / t), (a * 120.0));
} else if ((a * 120.0) <= 1e-26) {
tmp = (x - y) / ((z - t) * 0.016666666666666666);
} else {
tmp = fma(-60.0, (y / z), (a * 120.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e+61) tmp = fma(y, Float64(60.0 / t), Float64(a * 120.0)); elseif (Float64(a * 120.0) <= 1e-26) tmp = Float64(Float64(x - y) / Float64(Float64(z - t) * 0.016666666666666666)); else tmp = fma(-60.0, Float64(y / z), Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e+61], N[(y * N[(60.0 / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-26], N[(N[(x - y), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{60}{t}, a \cdot 120\right)\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-26}:\\
\;\;\;\;\frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000018e61Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
Taylor expanded in x around 0
Applied rewrites76.7%
if -5.00000000000000018e61 < (*.f64 a #s(literal 120 binary64)) < 1e-26Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6421.6
Applied rewrites21.6%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6480.7
Applied rewrites80.7%
Applied rewrites80.7%
if 1e-26 < (*.f64 a #s(literal 120 binary64)) Initial program 98.5%
Taylor expanded in z around inf
lower-*.f6473.5
Applied rewrites73.5%
Taylor expanded in z around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in x around 0
Applied rewrites76.3%
Final simplification78.7%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -5e+61)
(fma y (/ 60.0 t) (* a 120.0))
(if (<= (* a 120.0) 1e-26)
(/ (* 60.0 (- x y)) (- z t))
(fma -60.0 (/ y z) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e+61) {
tmp = fma(y, (60.0 / t), (a * 120.0));
} else if ((a * 120.0) <= 1e-26) {
tmp = (60.0 * (x - y)) / (z - t);
} else {
tmp = fma(-60.0, (y / z), (a * 120.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e+61) tmp = fma(y, Float64(60.0 / t), Float64(a * 120.0)); elseif (Float64(a * 120.0) <= 1e-26) tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)); else tmp = fma(-60.0, Float64(y / z), Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e+61], N[(y * N[(60.0 / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-26], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{60}{t}, a \cdot 120\right)\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-26}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000018e61Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
Taylor expanded in x around 0
Applied rewrites76.7%
if -5.00000000000000018e61 < (*.f64 a #s(literal 120 binary64)) < 1e-26Initial program 99.7%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6480.7
Applied rewrites80.7%
if 1e-26 < (*.f64 a #s(literal 120 binary64)) Initial program 98.5%
Taylor expanded in z around inf
lower-*.f6473.5
Applied rewrites73.5%
Taylor expanded in z around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in x around 0
Applied rewrites76.3%
Final simplification78.7%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -5e+61)
(fma y (/ 60.0 t) (* a 120.0))
(if (<= (* a 120.0) 1e-26)
(* (- x y) (/ 60.0 (- z t)))
(fma -60.0 (/ y z) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e+61) {
tmp = fma(y, (60.0 / t), (a * 120.0));
} else if ((a * 120.0) <= 1e-26) {
tmp = (x - y) * (60.0 / (z - t));
} else {
tmp = fma(-60.0, (y / z), (a * 120.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e+61) tmp = fma(y, Float64(60.0 / t), Float64(a * 120.0)); elseif (Float64(a * 120.0) <= 1e-26) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); else tmp = fma(-60.0, Float64(y / z), Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e+61], N[(y * N[(60.0 / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-26], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{60}{t}, a \cdot 120\right)\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-26}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000018e61Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
Taylor expanded in x around 0
Applied rewrites76.7%
if -5.00000000000000018e61 < (*.f64 a #s(literal 120 binary64)) < 1e-26Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6421.6
Applied rewrites21.6%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6480.7
Applied rewrites80.7%
Applied rewrites80.6%
if 1e-26 < (*.f64 a #s(literal 120 binary64)) Initial program 98.5%
Taylor expanded in z around inf
lower-*.f6473.5
Applied rewrites73.5%
Taylor expanded in z around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6465.4
Applied rewrites65.4%
Taylor expanded in x around 0
Applied rewrites76.3%
Final simplification78.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9e+39)
(fma a 120.0 (/ (* 60.0 (- x y)) z))
(if (<= z 2.6e-86)
(fma -60.0 (/ (- x y) t) (* a 120.0))
(fma 60.0 (/ (- x y) z) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e+39) {
tmp = fma(a, 120.0, ((60.0 * (x - y)) / z));
} else if (z <= 2.6e-86) {
tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
} else {
tmp = fma(60.0, ((x - y) / z), (a * 120.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9e+39) tmp = fma(a, 120.0, Float64(Float64(60.0 * Float64(x - y)) / z)); elseif (z <= 2.6e-86) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0)); else tmp = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9e+39], N[(a * 120.0 + N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-86], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot \left(x - y\right)}{z}\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-86}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
\end{array}
\end{array}
if z < -8.99999999999999991e39Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6493.9
Applied rewrites93.9%
if -8.99999999999999991e39 < z < 2.6000000000000001e-86Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6484.8
Applied rewrites84.8%
if 2.6000000000000001e-86 < z Initial program 98.6%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6484.3
Applied rewrites84.3%
Final simplification86.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ (- x y) z) (* a 120.0))))
(if (<= z -9e+39)
t_1
(if (<= z 2.6e-86) (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 <= -9e+39) {
tmp = t_1;
} else if (z <= 2.6e-86) {
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 <= -9e+39) tmp = t_1; elseif (z <= 2.6e-86) 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, -9e+39], t$95$1, If[LessEqual[z, 2.6e-86], 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 -9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-86}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.99999999999999991e39 or 2.6000000000000001e-86 < z Initial program 99.0%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6487.8
Applied rewrites87.8%
if -8.99999999999999991e39 < z < 2.6000000000000001e-86Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6484.8
Applied rewrites84.8%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9.2e+39)
(fma 120.0 a (/ (* 60.0 x) z))
(if (<= z 1.9e-93)
(fma y (/ 60.0 t) (* a 120.0))
(fma -60.0 (/ y z) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.2e+39) {
tmp = fma(120.0, a, ((60.0 * x) / z));
} else if (z <= 1.9e-93) {
tmp = fma(y, (60.0 / t), (a * 120.0));
} else {
tmp = fma(-60.0, (y / z), (a * 120.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.2e+39) tmp = fma(120.0, a, Float64(Float64(60.0 * x) / z)); elseif (z <= 1.9e-93) tmp = fma(y, Float64(60.0 / t), Float64(a * 120.0)); else tmp = fma(-60.0, Float64(y / z), Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.2e+39], N[(120.0 * a + N[(N[(60.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-93], N[(y * N[(60.0 / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(120, a, \frac{60 \cdot x}{z}\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-93}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{60}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\end{array}
\end{array}
if z < -9.20000000000000047e39Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6449.5
Applied rewrites49.5%
Taylor expanded in z around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6493.8
Applied rewrites93.8%
Taylor expanded in y around 0
Applied rewrites75.1%
if -9.20000000000000047e39 < z < 1.8999999999999999e-93Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6484.7
Applied rewrites84.7%
Taylor expanded in x around 0
Applied rewrites66.5%
if 1.8999999999999999e-93 < z Initial program 98.6%
Taylor expanded in z around inf
lower-*.f6449.3
Applied rewrites49.3%
Taylor expanded in z around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6483.4
Applied rewrites83.4%
Taylor expanded in x around 0
Applied rewrites72.9%
Final simplification70.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma y (/ 60.0 t) (* a 120.0)))) (if (<= t -5.5e-83) t_1 (if (<= t 8.2e-85) (/ (* 60.0 (- x y)) z) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (60.0 / t), (a * 120.0));
double tmp;
if (t <= -5.5e-83) {
tmp = t_1;
} else if (t <= 8.2e-85) {
tmp = (60.0 * (x - y)) / z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(60.0 / t), Float64(a * 120.0)) tmp = 0.0 if (t <= -5.5e-83) tmp = t_1; elseif (t <= 8.2e-85) tmp = Float64(Float64(60.0 * Float64(x - y)) / z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(60.0 / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e-83], t$95$1, If[LessEqual[t, 8.2e-85], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{60}{t}, a \cdot 120\right)\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-85}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.49999999999999964e-83 or 8.19999999999999987e-85 < t Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6481.1
Applied rewrites81.1%
Taylor expanded in x around 0
Applied rewrites71.1%
if -5.49999999999999964e-83 < t < 8.19999999999999987e-85Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6426.8
Applied rewrites26.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6475.5
Applied rewrites75.5%
Taylor expanded in z around inf
Applied rewrites66.1%
Final simplification69.2%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.5e+150) (/ (* y -60.0) (- z t)) (if (<= y 3.8e+82) (* a 120.0) (* -60.0 (/ y (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.5e+150) {
tmp = (y * -60.0) / (z - t);
} else if (y <= 3.8e+82) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.5d+150)) then
tmp = (y * (-60.0d0)) / (z - t)
else if (y <= 3.8d+82) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (y / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.5e+150) {
tmp = (y * -60.0) / (z - t);
} else if (y <= 3.8e+82) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.5e+150: tmp = (y * -60.0) / (z - t) elif y <= 3.8e+82: tmp = a * 120.0 else: tmp = -60.0 * (y / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.5e+150) tmp = Float64(Float64(y * -60.0) / Float64(z - t)); elseif (y <= 3.8e+82) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(y / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.5e+150) tmp = (y * -60.0) / (z - t); elseif (y <= 3.8e+82) tmp = a * 120.0; else tmp = -60.0 * (y / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.5e+150], N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+82], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+150}:\\
\;\;\;\;\frac{y \cdot -60}{z - t}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+82}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\end{array}
\end{array}
if y < -3.49999999999999984e150Initial program 97.4%
Taylor expanded in z around inf
lower-*.f6423.2
Applied rewrites23.2%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6468.2
Applied rewrites68.2%
if -3.49999999999999984e150 < y < 3.80000000000000033e82Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.6
Applied rewrites59.6%
if 3.80000000000000033e82 < y Initial program 99.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6473.1
Applied rewrites73.1%
Final simplification63.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ y (- z t))))) (if (<= y -3.5e+150) t_1 (if (<= y 3.8e+82) (* 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 <= -3.5e+150) {
tmp = t_1;
} else if (y <= 3.8e+82) {
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 <= (-3.5d+150)) then
tmp = t_1
else if (y <= 3.8d+82) 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 <= -3.5e+150) {
tmp = t_1;
} else if (y <= 3.8e+82) {
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 <= -3.5e+150: tmp = t_1 elif y <= 3.8e+82: 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 <= -3.5e+150) tmp = t_1; elseif (y <= 3.8e+82) 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 <= -3.5e+150) tmp = t_1; elseif (y <= 3.8e+82) 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, -3.5e+150], t$95$1, If[LessEqual[y, 3.8e+82], 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 -3.5 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+82}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.49999999999999984e150 or 3.80000000000000033e82 < y Initial program 98.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6470.9
Applied rewrites70.9%
if -3.49999999999999984e150 < y < 3.80000000000000033e82Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.6
Applied rewrites59.6%
Final simplification63.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.1e+152) (/ (* 60.0 y) t) (if (<= y 1.4e+130) (* a 120.0) (/ (* y -60.0) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+152) {
tmp = (60.0 * y) / t;
} else if (y <= 1.4e+130) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / z;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.1d+152)) then
tmp = (60.0d0 * y) / t
else if (y <= 1.4d+130) then
tmp = a * 120.0d0
else
tmp = (y * (-60.0d0)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+152) {
tmp = (60.0 * y) / t;
} else if (y <= 1.4e+130) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e+152: tmp = (60.0 * y) / t elif y <= 1.4e+130: tmp = a * 120.0 else: tmp = (y * -60.0) / z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e+152) tmp = Float64(Float64(60.0 * y) / t); elseif (y <= 1.4e+130) tmp = Float64(a * 120.0); else tmp = Float64(Float64(y * -60.0) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.1e+152) tmp = (60.0 * y) / t; elseif (y <= 1.4e+130) tmp = a * 120.0; else tmp = (y * -60.0) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+152], N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 1.4e+130], N[(a * 120.0), $MachinePrecision], N[(N[(y * -60.0), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+152}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+130}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z}\\
\end{array}
\end{array}
if y < -3.1e152Initial program 97.4%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in y around inf
Applied rewrites42.5%
if -3.1e152 < y < 1.3999999999999999e130Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6456.1
Applied rewrites56.1%
if 1.3999999999999999e130 < y Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6416.0
Applied rewrites16.0%
Taylor expanded in z around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6468.4
Applied rewrites68.4%
Taylor expanded in y around inf
Applied rewrites59.1%
Final simplification54.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.1e+152) (/ (* 60.0 y) t) (if (<= y 4.5e+87) (* a 120.0) (* 60.0 (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+152) {
tmp = (60.0 * y) / t;
} else if (y <= 4.5e+87) {
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 <= (-3.1d+152)) then
tmp = (60.0d0 * y) / t
else if (y <= 4.5d+87) 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 <= -3.1e+152) {
tmp = (60.0 * y) / t;
} else if (y <= 4.5e+87) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e+152: tmp = (60.0 * y) / t elif y <= 4.5e+87: tmp = a * 120.0 else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e+152) tmp = Float64(Float64(60.0 * y) / t); elseif (y <= 4.5e+87) 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 <= -3.1e+152) tmp = (60.0 * y) / t; elseif (y <= 4.5e+87) tmp = a * 120.0; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+152], N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 4.5e+87], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+152}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < -3.1e152Initial program 97.4%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in y around inf
Applied rewrites42.5%
if -3.1e152 < y < 4.5000000000000003e87Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.1
Applied rewrites59.1%
if 4.5000000000000003e87 < y Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6453.5
Applied rewrites53.5%
Taylor expanded in y around inf
Applied rewrites40.5%
Applied rewrites40.6%
Final simplification52.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.1e+152) (* y (/ 60.0 t)) (if (<= y 4.5e+87) (* a 120.0) (* 60.0 (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e+152) {
tmp = y * (60.0 / t);
} else if (y <= 4.5e+87) {
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 <= (-3.1d+152)) then
tmp = y * (60.0d0 / t)
else if (y <= 4.5d+87) 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 <= -3.1e+152) {
tmp = y * (60.0 / t);
} else if (y <= 4.5e+87) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e+152: tmp = y * (60.0 / t) elif y <= 4.5e+87: tmp = a * 120.0 else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e+152) tmp = Float64(y * Float64(60.0 / t)); elseif (y <= 4.5e+87) 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 <= -3.1e+152) tmp = y * (60.0 / t); elseif (y <= 4.5e+87) tmp = a * 120.0; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+152], N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+87], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+152}:\\
\;\;\;\;y \cdot \frac{60}{t}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < -3.1e152Initial program 97.4%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in y around inf
Applied rewrites42.5%
Applied rewrites42.5%
if -3.1e152 < y < 4.5000000000000003e87Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.1
Applied rewrites59.1%
if 4.5000000000000003e87 < y Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6453.5
Applied rewrites53.5%
Taylor expanded in y around inf
Applied rewrites40.5%
Applied rewrites40.6%
Final simplification52.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ y t)))) (if (<= y -3.1e+152) t_1 (if (<= y 4.5e+87) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (y / t);
double tmp;
if (y <= -3.1e+152) {
tmp = t_1;
} else if (y <= 4.5e+87) {
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 / t)
if (y <= (-3.1d+152)) then
tmp = t_1
else if (y <= 4.5d+87) 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 / t);
double tmp;
if (y <= -3.1e+152) {
tmp = t_1;
} else if (y <= 4.5e+87) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (y / t) tmp = 0 if y <= -3.1e+152: tmp = t_1 elif y <= 4.5e+87: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(y / t)) tmp = 0.0 if (y <= -3.1e+152) tmp = t_1; elseif (y <= 4.5e+87) 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 / t); tmp = 0.0; if (y <= -3.1e+152) tmp = t_1; elseif (y <= 4.5e+87) 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 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e+152], t$95$1, If[LessEqual[y, 4.5e+87], N[(a * 120.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{y}{t}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+87}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.1e152 or 4.5000000000000003e87 < y Initial program 98.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.9
Applied rewrites56.9%
Taylor expanded in y around inf
Applied rewrites41.4%
Applied rewrites41.4%
if -3.1e152 < y < 4.5000000000000003e87Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.1
Applied rewrites59.1%
Final simplification52.8%
(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%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ (* (- x y) -60.0) (- t z))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, (((x - y) * -60.0) / (t - z)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(Float64(x - y) * -60.0) / Float64(t - z))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{\left(x - y\right) \cdot -60}{t - z}\right)
\end{array}
Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.4
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.4
Applied rewrites99.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.4%
Taylor expanded in z around inf
lower-*.f6445.1
Applied rewrites45.1%
Final simplification45.1%
(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 2024233
(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)))