
(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 16 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 a 120.0 (/ (- x y) (* (- t z) -0.016666666666666666))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) / ((t - z) * -0.016666666666666666)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) / Float64(Float64(t - z) * -0.016666666666666666))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{x - y}{\left(t - z\right) \cdot -0.016666666666666666}\right)
\end{array}
Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/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%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval99.8
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+84)
(* (/ y (- z t)) -60.0)
(if (<= t_1 1e+20)
(* 120.0 a)
(if (<= t_1 1e+205)
(fma (/ y t) 60.0 (* 120.0 a))
(* (/ (- x y) z) 60.0))))))
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+84) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 1e+20) {
tmp = 120.0 * a;
} else if (t_1 <= 1e+205) {
tmp = fma((y / t), 60.0, (120.0 * a));
} else {
tmp = ((x - y) / z) * 60.0;
}
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+84) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (t_1 <= 1e+20) tmp = Float64(120.0 * a); elseif (t_1 <= 1e+205) tmp = fma(Float64(y / t), 60.0, Float64(120.0 * a)); else tmp = Float64(Float64(Float64(x - y) / z) * 60.0); 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[t$95$1, -2e+84], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+20], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$1, 1e+205], N[(N[(y / t), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision]]]]]
\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^{+84}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq 10^{+20}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_1 \leq 10^{+205}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000012e84Initial program 97.4%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6491.2
Applied rewrites91.2%
Taylor expanded in x around 0
Applied rewrites56.9%
if -2.00000000000000012e84 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e20Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6477.8
Applied rewrites77.8%
if 1e20 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000002e205Initial program 99.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6470.4
Applied rewrites70.4%
Taylor expanded in x around 0
Applied rewrites57.3%
if 1.00000000000000002e205 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6494.5
Applied rewrites94.5%
Taylor expanded in z around inf
Applied rewrites83.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -2e+84) (not (<= t_1 1e+152)))
(* y (/ -60.0 (- z t)))
(* 120.0 a))))
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+84) || !(t_1 <= 1e+152)) {
tmp = y * (-60.0 / (z - t));
} else {
tmp = 120.0 * a;
}
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+84)) .or. (.not. (t_1 <= 1d+152))) then
tmp = y * ((-60.0d0) / (z - t))
else
tmp = 120.0d0 * a
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+84) || !(t_1 <= 1e+152)) {
tmp = y * (-60.0 / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if (t_1 <= -2e+84) or not (t_1 <= 1e+152): tmp = y * (-60.0 / (z - t)) else: tmp = 120.0 * a 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+84) || !(t_1 <= 1e+152)) tmp = Float64(y * Float64(-60.0 / Float64(z - t))); else tmp = Float64(120.0 * a); 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+84) || ~((t_1 <= 1e+152))) tmp = y * (-60.0 / (z - t)); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+84], N[Not[LessEqual[t$95$1, 1e+152]], $MachinePrecision]], N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\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^{+84} \lor \neg \left(t\_1 \leq 10^{+152}\right):\\
\;\;\;\;y \cdot \frac{-60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000012e84 or 1e152 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6490.0
Applied rewrites90.0%
Taylor expanded in x around 0
Applied rewrites55.5%
Applied rewrites55.5%
if -2.00000000000000012e84 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e152Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6472.9
Applied rewrites72.9%
Final simplification68.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+84)
(* (/ y (- z t)) -60.0)
(if (<= t_1 1e+152) (* 120.0 a) (* (/ (- x y) z) 60.0)))))
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+84) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 1e+152) {
tmp = 120.0 * a;
} else {
tmp = ((x - y) / z) * 60.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) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-2d+84)) then
tmp = (y / (z - t)) * (-60.0d0)
else if (t_1 <= 1d+152) then
tmp = 120.0d0 * a
else
tmp = ((x - y) / z) * 60.0d0
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+84) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 1e+152) {
tmp = 120.0 * a;
} else {
tmp = ((x - y) / z) * 60.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+84: tmp = (y / (z - t)) * -60.0 elif t_1 <= 1e+152: tmp = 120.0 * a else: tmp = ((x - y) / z) * 60.0 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+84) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (t_1 <= 1e+152) tmp = Float64(120.0 * a); else tmp = Float64(Float64(Float64(x - y) / z) * 60.0); 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+84) tmp = (y / (z - t)) * -60.0; elseif (t_1 <= 1e+152) tmp = 120.0 * a; else tmp = ((x - y) / z) * 60.0; 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+84], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+152], N[(120.0 * a), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision]]]]
\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^{+84}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq 10^{+152}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000012e84Initial program 97.4%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6491.2
Applied rewrites91.2%
Taylor expanded in x around 0
Applied rewrites56.9%
if -2.00000000000000012e84 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e152Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6472.9
Applied rewrites72.9%
if 1e152 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.0
Applied rewrites88.0%
Taylor expanded in z around inf
Applied rewrites69.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+84)
(* (/ y (- z t)) -60.0)
(if (<= t_1 1e+152) (* 120.0 a) (* y (/ -60.0 (- z t)))))))
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+84) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 1e+152) {
tmp = 120.0 * a;
} 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) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-2d+84)) then
tmp = (y / (z - t)) * (-60.0d0)
else if (t_1 <= 1d+152) then
tmp = 120.0d0 * a
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 t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+84) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 1e+152) {
tmp = 120.0 * a;
} else {
tmp = y * (-60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+84: tmp = (y / (z - t)) * -60.0 elif t_1 <= 1e+152: tmp = 120.0 * a else: tmp = y * (-60.0 / (z - t)) 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+84) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (t_1 <= 1e+152) tmp = Float64(120.0 * a); else tmp = Float64(y * Float64(-60.0 / Float64(z - t))); 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+84) tmp = (y / (z - t)) * -60.0; elseif (t_1 <= 1e+152) tmp = 120.0 * a; else tmp = y * (-60.0 / (z - t)); 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+84], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+152], N[(120.0 * a), $MachinePrecision], N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+84}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq 10^{+152}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-60}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000012e84Initial program 97.4%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6491.2
Applied rewrites91.2%
Taylor expanded in x around 0
Applied rewrites56.9%
if -2.00000000000000012e84 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e152Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6472.9
Applied rewrites72.9%
if 1e152 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.0
Applied rewrites88.0%
Taylor expanded in x around 0
Applied rewrites53.3%
Applied rewrites53.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -5e+138) (not (<= t_1 2e+180)))
(* (/ y z) -60.0)
(* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+138) || !(t_1 <= 2e+180)) {
tmp = (y / z) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if ((t_1 <= (-5d+138)) .or. (.not. (t_1 <= 2d+180))) then
tmp = (y / z) * (-60.0d0)
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+138) || !(t_1 <= 2e+180)) {
tmp = (y / z) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if (t_1 <= -5e+138) or not (t_1 <= 2e+180): tmp = (y / z) * -60.0 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -5e+138) || !(t_1 <= 2e+180)) tmp = Float64(Float64(y / z) * -60.0); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if ((t_1 <= -5e+138) || ~((t_1 <= 2e+180))) tmp = (y / z) * -60.0; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+138], N[Not[LessEqual[t$95$1, 2e+180]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+138} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+180}\right):\\
\;\;\;\;\frac{y}{z} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000016e138 or 2e180 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6496.0
Applied rewrites96.0%
Taylor expanded in x around 0
Applied rewrites60.9%
Taylor expanded in z around inf
Applied rewrites39.9%
if -5.00000000000000016e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e180Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6469.8
Applied rewrites69.8%
Final simplification64.0%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -1e+64)
(* 120.0 a)
(if (<= (* a 120.0) -2e-115)
(fma (/ (- x y) t) -60.0 (* 120.0 a))
(if (<= (* a 120.0) 5e-52) (* (- x y) (/ -60.0 (- t z))) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+64) {
tmp = 120.0 * a;
} else if ((a * 120.0) <= -2e-115) {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
} else if ((a * 120.0) <= 5e-52) {
tmp = (x - y) * (-60.0 / (t - z));
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e+64) tmp = Float64(120.0 * a); elseif (Float64(a * 120.0) <= -2e-115) tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); elseif (Float64(a * 120.0) <= 5e-52) tmp = Float64(Float64(x - y) * Float64(-60.0 / Float64(t - z))); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+64], N[(120.0 * a), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], -2e-115], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-52], N[(N[(x - y), $MachinePrecision] * N[(-60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+64}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-115}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{-52}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t - z}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1.00000000000000002e64 or 5e-52 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6484.7
Applied rewrites84.7%
if -1.00000000000000002e64 < (*.f64 a #s(literal 120 binary64)) < -2.0000000000000001e-115Initial program 99.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6480.4
Applied rewrites80.4%
if -2.0000000000000001e-115 < (*.f64 a #s(literal 120 binary64)) < 5e-52Initial program 98.6%
Taylor expanded in z around inf
lower-*.f6420.8
Applied rewrites20.8%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
remove-double-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
distribute-neg-frac2N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
remove-double-negN/A
unsub-negN/A
distribute-neg-inN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
Applied rewrites82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -2e+30) (not (<= (* a 120.0) 5e-52))) (* 120.0 a) (* (- x y) (/ -60.0 (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -2e+30) || !((a * 120.0) <= 5e-52)) {
tmp = 120.0 * a;
} else {
tmp = (x - 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 (((a * 120.0d0) <= (-2d+30)) .or. (.not. ((a * 120.0d0) <= 5d-52))) then
tmp = 120.0d0 * a
else
tmp = (x - 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 (((a * 120.0) <= -2e+30) || !((a * 120.0) <= 5e-52)) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (-60.0 / (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -2e+30) or not ((a * 120.0) <= 5e-52): tmp = 120.0 * a else: tmp = (x - y) * (-60.0 / (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -2e+30) || !(Float64(a * 120.0) <= 5e-52)) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x - y) * Float64(-60.0 / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -2e+30) || ~(((a * 120.0) <= 5e-52))) tmp = 120.0 * a; else tmp = (x - y) * (-60.0 / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -2e+30], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-52]], $MachinePrecision]], N[(120.0 * a), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(-60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -2 \cdot 10^{+30} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-52}\right):\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t - z}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -2e30 or 5e-52 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6483.5
Applied rewrites83.5%
if -2e30 < (*.f64 a #s(literal 120 binary64)) < 5e-52Initial program 98.9%
Taylor expanded in z around inf
lower-*.f6422.7
Applied rewrites22.7%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
remove-double-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
distribute-neg-frac2N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
remove-double-negN/A
unsub-negN/A
distribute-neg-inN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
Applied rewrites78.8%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -5e-16) (not (<= (* a 120.0) 2e-89))) (* 120.0 a) (/ (* -60.0 x) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -5e-16) || !((a * 120.0) <= 2e-89)) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 * x) / (t - z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a * 120.0d0) <= (-5d-16)) .or. (.not. ((a * 120.0d0) <= 2d-89))) then
tmp = 120.0d0 * a
else
tmp = ((-60.0d0) * x) / (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -5e-16) || !((a * 120.0) <= 2e-89)) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 * x) / (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -5e-16) or not ((a * 120.0) <= 2e-89): tmp = 120.0 * a else: tmp = (-60.0 * x) / (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -5e-16) || !(Float64(a * 120.0) <= 2e-89)) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 * x) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -5e-16) || ~(((a * 120.0) <= 2e-89))) tmp = 120.0 * a; else tmp = (-60.0 * x) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -5e-16], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-89]], $MachinePrecision]], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 * x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-16} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-89}\right):\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60 \cdot x}{t - z}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.0000000000000004e-16 or 2.00000000000000008e-89 < (*.f64 a #s(literal 120 binary64)) Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6478.1
Applied rewrites78.1%
if -5.0000000000000004e-16 < (*.f64 a #s(literal 120 binary64)) < 2.00000000000000008e-89Initial program 98.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6498.7
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/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.6
Applied rewrites99.6%
Taylor expanded in x around inf
associate-*r/N/A
remove-double-negN/A
unsub-negN/A
distribute-neg-inN/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6443.2
Applied rewrites43.2%
Final simplification65.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.02e-28)
(fma a 120.0 (/ (* y -60.0) (- z t)))
(if (<= y 1.45e+42)
(+ (/ (* 60.0 x) (- z t)) (* a 120.0))
(+ (* (/ -60.0 (- z t)) y) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.02e-28) {
tmp = fma(a, 120.0, ((y * -60.0) / (z - t)));
} else if (y <= 1.45e+42) {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
} else {
tmp = ((-60.0 / (z - t)) * y) + (a * 120.0);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.02e-28) tmp = fma(a, 120.0, Float64(Float64(y * -60.0) / Float64(z - t))); elseif (y <= 1.45e+42) tmp = Float64(Float64(Float64(60.0 * x) / Float64(z - t)) + Float64(a * 120.0)); else tmp = Float64(Float64(Float64(-60.0 / Float64(z - t)) * y) + Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.02e-28], N[(a * 120.0 + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+42], N[(N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z - t}\right)\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+42}:\\
\;\;\;\;\frac{60 \cdot x}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{z - t} \cdot y + a \cdot 120\\
\end{array}
\end{array}
if y < -1.01999999999999997e-28Initial program 99.7%
Taylor expanded in x around 0
lower-*.f6490.1
Applied rewrites90.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6490.1
Applied rewrites90.1%
if -1.01999999999999997e-28 < y < 1.4499999999999999e42Initial program 99.8%
Taylor expanded in x around inf
lower-*.f6497.2
Applied rewrites97.2%
if 1.4499999999999999e42 < y Initial program 97.7%
Taylor expanded in x around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6492.3
Applied rewrites92.3%
Final simplification94.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e-38) (not (<= t 4.1e-76))) (fma a 120.0 (* (/ -60.0 t) (- x y))) (fma (/ (- x y) z) 60.0 (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e-38) || !(t <= 4.1e-76)) {
tmp = fma(a, 120.0, ((-60.0 / t) * (x - y)));
} else {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e-38) || !(t <= 4.1e-76)) tmp = fma(a, 120.0, Float64(Float64(-60.0 / t) * Float64(x - y))); else tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.6e-38], N[Not[LessEqual[t, 4.1e-76]], $MachinePrecision]], N[(a * 120.0 + N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-38} \lor \neg \left(t \leq 4.1 \cdot 10^{-76}\right):\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{t} \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -1.59999999999999989e-38 or 4.0999999999999998e-76 < t Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/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.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6489.6
Applied rewrites89.6%
if -1.59999999999999989e-38 < t < 4.0999999999999998e-76Initial program 98.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6492.2
Applied rewrites92.2%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e-38) (not (<= t 4.1e-76))) (fma (/ (- x y) t) -60.0 (* 120.0 a)) (fma (/ (- x y) z) 60.0 (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e-38) || !(t <= 4.1e-76)) {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
} else {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e-38) || !(t <= 4.1e-76)) tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); else tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.6e-38], N[Not[LessEqual[t, 4.1e-76]], $MachinePrecision]], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-38} \lor \neg \left(t \leq 4.1 \cdot 10^{-76}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -1.59999999999999989e-38 or 4.0999999999999998e-76 < t Initial program 99.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
if -1.59999999999999989e-38 < t < 4.0999999999999998e-76Initial program 98.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6492.2
Applied rewrites92.2%
Final simplification90.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.6e-38)
(fma a 120.0 (/ (- x y) (* -0.016666666666666666 t)))
(if (<= t 3.5e-81)
(fma (/ (- x y) z) 60.0 (* 120.0 a))
(fma a 120.0 (/ (* y -60.0) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e-38) {
tmp = fma(a, 120.0, ((x - y) / (-0.016666666666666666 * t)));
} else if (t <= 3.5e-81) {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
} else {
tmp = fma(a, 120.0, ((y * -60.0) / (z - t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e-38) tmp = fma(a, 120.0, Float64(Float64(x - y) / Float64(-0.016666666666666666 * t))); elseif (t <= 3.5e-81) tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); else tmp = fma(a, 120.0, Float64(Float64(y * -60.0) / Float64(z - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e-38], N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(-0.016666666666666666 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-81], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{-0.016666666666666666 \cdot t}\right)\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-81}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z - t}\right)\\
\end{array}
\end{array}
if t < -1.59999999999999989e-38Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/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.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-*.f6493.8
Applied rewrites93.8%
if -1.59999999999999989e-38 < t < 3.49999999999999986e-81Initial program 98.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6492.1
Applied rewrites92.1%
if 3.49999999999999986e-81 < t Initial program 99.8%
Taylor expanded in x around 0
lower-*.f6485.9
Applied rewrites85.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6486.0
Applied rewrites86.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.6e-38)
(fma a 120.0 (* (/ -60.0 t) (- x y)))
(if (<= t 3.5e-81)
(fma (/ (- x y) z) 60.0 (* 120.0 a))
(fma a 120.0 (/ (* y -60.0) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e-38) {
tmp = fma(a, 120.0, ((-60.0 / t) * (x - y)));
} else if (t <= 3.5e-81) {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
} else {
tmp = fma(a, 120.0, ((y * -60.0) / (z - t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e-38) tmp = fma(a, 120.0, Float64(Float64(-60.0 / t) * Float64(x - y))); elseif (t <= 3.5e-81) tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); else tmp = fma(a, 120.0, Float64(Float64(y * -60.0) / Float64(z - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e-38], N[(a * 120.0 + N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-81], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{t} \cdot \left(x - y\right)\right)\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-81}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z - t}\right)\\
\end{array}
\end{array}
if t < -1.59999999999999989e-38Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/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.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6493.7
Applied rewrites93.7%
if -1.59999999999999989e-38 < t < 3.49999999999999986e-81Initial program 98.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6492.1
Applied rewrites92.1%
if 3.49999999999999986e-81 < t Initial program 99.8%
Taylor expanded in x around 0
lower-*.f6485.9
Applied rewrites85.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6486.0
Applied rewrites86.0%
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (* (/ -60.0 (- t z)) (- x y))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((-60.0 / (t - z)) * (x - y)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(-60.0 / Float64(t - z)) * Float64(x - y))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(-60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{-60}{t - z} \cdot \left(x - y\right)\right)
\end{array}
Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/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%
(FPCore (x y z t a) :precision binary64 (* 120.0 a))
double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
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 = 120.0d0 * a
end function
public static double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
def code(x, y, z, t, a): return 120.0 * a
function code(x, y, z, t, a) return Float64(120.0 * a) end
function tmp = code(x, y, z, t, a) tmp = 120.0 * a; end
code[x_, y_, z_, t_, a_] := N[(120.0 * a), $MachinePrecision]
\begin{array}{l}
\\
120 \cdot a
\end{array}
Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6457.4
Applied rewrites57.4%
(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 2024323
(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)))