
(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 15 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) (fma 0.016666666666666666 z (* -0.016666666666666666 t)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) / fma(0.016666666666666666, z, (-0.016666666666666666 * t))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) / fma(0.016666666666666666, z, Float64(-0.016666666666666666 * t)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(0.016666666666666666 * z + N[(-0.016666666666666666 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{x - y}{\mathsf{fma}\left(0.016666666666666666, z, -0.016666666666666666 \cdot t\right)}\right)
\end{array}
Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.4
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
clear-numN/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval99.7
Applied rewrites99.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
un-div-invN/A
lower-/.f64N/A
lift--.f6499.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+233)
(* (/ y (- z t)) -60.0)
(if (<= t_1 -1e+87)
(* x (/ 60.0 (- z t)))
(if (<= t_1 5e+138) (* 120.0 a) (/ (* (- x y) 60.0) z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+233) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= -1e+87) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= 5e+138) {
tmp = 120.0 * a;
} else {
tmp = ((x - 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) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-2d+233)) then
tmp = (y / (z - t)) * (-60.0d0)
else if (t_1 <= (-1d+87)) then
tmp = x * (60.0d0 / (z - t))
else if (t_1 <= 5d+138) then
tmp = 120.0d0 * a
else
tmp = ((x - 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 t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+233) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= -1e+87) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= 5e+138) {
tmp = 120.0 * a;
} else {
tmp = ((x - y) * 60.0) / z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+233: tmp = (y / (z - t)) * -60.0 elif t_1 <= -1e+87: tmp = x * (60.0 / (z - t)) elif t_1 <= 5e+138: tmp = 120.0 * a else: tmp = ((x - y) * 60.0) / z return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+233) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (t_1 <= -1e+87) tmp = Float64(x * Float64(60.0 / Float64(z - t))); elseif (t_1 <= 5e+138) tmp = Float64(120.0 * a); else tmp = Float64(Float64(Float64(x - y) * 60.0) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -2e+233) tmp = (y / (z - t)) * -60.0; elseif (t_1 <= -1e+87) tmp = x * (60.0 / (z - t)); elseif (t_1 <= 5e+138) tmp = 120.0 * a; else tmp = ((x - y) * 60.0) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+233], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, -1e+87], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+138], N[(120.0 * a), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / z), $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^{+233}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+87}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+138}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.99999999999999995e233Initial program 94.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6489.8
Applied rewrites89.8%
Taylor expanded in x around 0
Applied rewrites62.9%
if -1.99999999999999995e233 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.9999999999999996e86Initial program 99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6458.5
Applied rewrites58.5%
Applied rewrites58.4%
if -9.9999999999999996e86 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000016e138Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6475.1
Applied rewrites75.1%
if 5.00000000000000016e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6457.7
Applied rewrites57.7%
Taylor expanded in z around 0
Applied rewrites57.8%
Taylor expanded in z around 0
Applied rewrites54.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -1e+87) (not (<= t_1 4e+52)))
(* (- x 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 <= -1e+87) || !(t_1 <= 4e+52)) {
tmp = (x - 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 <= (-1d+87)) .or. (.not. (t_1 <= 4d+52))) then
tmp = (x - 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 <= -1e+87) || !(t_1 <= 4e+52)) {
tmp = (x - 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 <= -1e+87) or not (t_1 <= 4e+52): tmp = (x - 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 <= -1e+87) || !(t_1 <= 4e+52)) tmp = Float64(Float64(x - 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 <= -1e+87) || ~((t_1 <= 4e+52))) tmp = (x - 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, -1e+87], N[Not[LessEqual[t$95$1, 4e+52]], $MachinePrecision]], N[(N[(x - y), $MachinePrecision] * 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 -1 \cdot 10^{+87} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+52}\right):\\
\;\;\;\;\left(x - y\right) \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)) < -9.9999999999999996e86 or 4e52 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6484.0
Applied rewrites84.0%
Applied rewrites84.0%
if -9.9999999999999996e86 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4e52Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6478.5
Applied rewrites78.5%
Final simplification80.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+87)
(* (/ (- x y) (- z t)) 60.0)
(if (<= t_1 4e+52) (* 120.0 a) (* (- x 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 <= -1e+87) {
tmp = ((x - y) / (z - t)) * 60.0;
} else if (t_1 <= 4e+52) {
tmp = 120.0 * a;
} else {
tmp = (x - 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 <= (-1d+87)) then
tmp = ((x - y) / (z - t)) * 60.0d0
else if (t_1 <= 4d+52) then
tmp = 120.0d0 * a
else
tmp = (x - 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 <= -1e+87) {
tmp = ((x - y) / (z - t)) * 60.0;
} else if (t_1 <= 4e+52) {
tmp = 120.0 * a;
} else {
tmp = (x - 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 <= -1e+87: tmp = ((x - y) / (z - t)) * 60.0 elif t_1 <= 4e+52: tmp = 120.0 * a else: tmp = (x - 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 <= -1e+87) tmp = Float64(Float64(Float64(x - y) / Float64(z - t)) * 60.0); elseif (t_1 <= 4e+52) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x - 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 <= -1e+87) tmp = ((x - y) / (z - t)) * 60.0; elseif (t_1 <= 4e+52) tmp = 120.0 * a; else tmp = (x - 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, -1e+87], N[(N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 4e+52], N[(120.0 * a), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * 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 -1 \cdot 10^{+87}:\\
\;\;\;\;\frac{x - y}{z - t} \cdot 60\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+52}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.9999999999999996e86Initial program 97.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6485.4
Applied rewrites85.4%
if -9.9999999999999996e86 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4e52Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6478.5
Applied rewrites78.5%
if 4e52 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6482.6
Applied rewrites82.6%
Applied rewrites82.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -1e+87) (not (<= t_1 5e+138)))
(* (/ (- y x) t) 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 <= -1e+87) || !(t_1 <= 5e+138)) {
tmp = ((y - x) / t) * 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 <= (-1d+87)) .or. (.not. (t_1 <= 5d+138))) then
tmp = ((y - x) / t) * 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 <= -1e+87) || !(t_1 <= 5e+138)) {
tmp = ((y - x) / t) * 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 <= -1e+87) or not (t_1 <= 5e+138): tmp = ((y - x) / t) * 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 <= -1e+87) || !(t_1 <= 5e+138)) tmp = Float64(Float64(Float64(y - x) / t) * 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 <= -1e+87) || ~((t_1 <= 5e+138))) tmp = ((y - x) / t) * 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, -1e+87], N[Not[LessEqual[t$95$1, 5e+138]], $MachinePrecision]], N[(N[(N[(y - x), $MachinePrecision] / t), $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 -1 \cdot 10^{+87} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+138}\right):\\
\;\;\;\;\frac{y - x}{t} \cdot 60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.9999999999999996e86 or 5.00000000000000016e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.5%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6488.5
Applied rewrites88.5%
Taylor expanded in z around 0
Applied rewrites58.4%
if -9.9999999999999996e86 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000016e138Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6475.1
Applied rewrites75.1%
Final simplification70.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -1e+162) (not (<= t_1 2e+147)))
(* (/ y (- z t)) -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 <= -1e+162) || !(t_1 <= 2e+147)) {
tmp = (y / (z - t)) * -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 <= (-1d+162)) .or. (.not. (t_1 <= 2d+147))) then
tmp = (y / (z - t)) * (-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 <= -1e+162) || !(t_1 <= 2e+147)) {
tmp = (y / (z - t)) * -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 <= -1e+162) or not (t_1 <= 2e+147): tmp = (y / (z - t)) * -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 <= -1e+162) || !(t_1 <= 2e+147)) tmp = Float64(Float64(y / Float64(z - t)) * -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 <= -1e+162) || ~((t_1 <= 2e+147))) tmp = (y / (z - t)) * -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, -1e+162], N[Not[LessEqual[t$95$1, 2e+147]], $MachinePrecision]], N[(N[(y / N[(z - t), $MachinePrecision]), $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 -1 \cdot 10^{+162} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+147}\right):\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.9999999999999994e161 or 2e147 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.2%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6492.0
Applied rewrites92.0%
Taylor expanded in x around 0
Applied rewrites50.9%
if -9.9999999999999994e161 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e147Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6471.5
Applied rewrites71.5%
Final simplification66.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+162)
(* (/ y (- z t)) -60.0)
(if (<= t_1 5e+138) (* 120.0 a) (/ (* (- x y) 60.0) z)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+162) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 5e+138) {
tmp = 120.0 * a;
} else {
tmp = ((x - 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) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+162)) then
tmp = (y / (z - t)) * (-60.0d0)
else if (t_1 <= 5d+138) then
tmp = 120.0d0 * a
else
tmp = ((x - 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 t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+162) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 5e+138) {
tmp = 120.0 * a;
} else {
tmp = ((x - y) * 60.0) / z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+162: tmp = (y / (z - t)) * -60.0 elif t_1 <= 5e+138: tmp = 120.0 * a else: tmp = ((x - y) * 60.0) / z return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+162) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (t_1 <= 5e+138) tmp = Float64(120.0 * a); else tmp = Float64(Float64(Float64(x - y) * 60.0) / z); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+162) tmp = (y / (z - t)) * -60.0; elseif (t_1 <= 5e+138) tmp = 120.0 * a; else tmp = ((x - y) * 60.0) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+162], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+138], N[(120.0 * a), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+162}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+138}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.9999999999999994e161Initial program 96.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6491.5
Applied rewrites91.5%
Taylor expanded in x around 0
Applied rewrites50.3%
if -9.9999999999999994e161 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000016e138Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6472.2
Applied rewrites72.2%
if 5.00000000000000016e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6457.7
Applied rewrites57.7%
Taylor expanded in z around 0
Applied rewrites57.8%
Taylor expanded in z around 0
Applied rewrites54.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -1e+162) (not (<= t_1 5e+138)))
(* x (/ -60.0 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 <= -1e+162) || !(t_1 <= 5e+138)) {
tmp = x * (-60.0 / 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 <= (-1d+162)) .or. (.not. (t_1 <= 5d+138))) then
tmp = x * ((-60.0d0) / 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 <= -1e+162) || !(t_1 <= 5e+138)) {
tmp = x * (-60.0 / 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 <= -1e+162) or not (t_1 <= 5e+138): tmp = x * (-60.0 / 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 <= -1e+162) || !(t_1 <= 5e+138)) tmp = Float64(x * Float64(-60.0 / 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 <= -1e+162) || ~((t_1 <= 5e+138))) tmp = x * (-60.0 / 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, -1e+162], N[Not[LessEqual[t$95$1, 5e+138]], $MachinePrecision]], N[(x * N[(-60.0 / t), $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 -1 \cdot 10^{+162} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+138}\right):\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.9999999999999994e161 or 5.00000000000000016e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6447.0
Applied rewrites47.0%
Taylor expanded in z around 0
Applied rewrites38.4%
Applied rewrites38.4%
if -9.9999999999999994e161 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000016e138Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6472.2
Applied rewrites72.2%
Final simplification63.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+162)
(* (/ x t) -60.0)
(if (<= t_1 5e+138) (* 120.0 a) (* x (/ -60.0 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 <= -1e+162) {
tmp = (x / t) * -60.0;
} else if (t_1 <= 5e+138) {
tmp = 120.0 * a;
} else {
tmp = x * (-60.0 / 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 <= (-1d+162)) then
tmp = (x / t) * (-60.0d0)
else if (t_1 <= 5d+138) then
tmp = 120.0d0 * a
else
tmp = x * ((-60.0d0) / 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 <= -1e+162) {
tmp = (x / t) * -60.0;
} else if (t_1 <= 5e+138) {
tmp = 120.0 * a;
} else {
tmp = x * (-60.0 / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+162: tmp = (x / t) * -60.0 elif t_1 <= 5e+138: tmp = 120.0 * a else: tmp = x * (-60.0 / 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 <= -1e+162) tmp = Float64(Float64(x / t) * -60.0); elseif (t_1 <= 5e+138) tmp = Float64(120.0 * a); else tmp = Float64(x * Float64(-60.0 / 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 <= -1e+162) tmp = (x / t) * -60.0; elseif (t_1 <= 5e+138) tmp = 120.0 * a; else tmp = x * (-60.0 / 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, -1e+162], N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+138], N[(120.0 * a), $MachinePrecision], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+162}:\\
\;\;\;\;\frac{x}{t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+138}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.9999999999999994e161Initial program 96.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6446.5
Applied rewrites46.5%
Taylor expanded in z around 0
Applied rewrites35.0%
if -9.9999999999999994e161 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000016e138Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6472.2
Applied rewrites72.2%
if 5.00000000000000016e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around 0
Applied rewrites42.1%
Applied rewrites42.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -1.52e-18) (not (<= x 4.6e-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 ((x <= -1.52e-18) || !(x <= 4.6e-42)) {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
} else {
tmp = ((-60.0 / (z - t)) * y) + (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 ((x <= (-1.52d-18)) .or. (.not. (x <= 4.6d-42))) then
tmp = ((60.0d0 * x) / (z - t)) + (a * 120.0d0)
else
tmp = (((-60.0d0) / (z - t)) * y) + (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 ((x <= -1.52e-18) || !(x <= 4.6e-42)) {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
} else {
tmp = ((-60.0 / (z - t)) * y) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -1.52e-18) or not (x <= 4.6e-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 ((x <= -1.52e-18) || !(x <= 4.6e-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
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -1.52e-18) || ~((x <= 4.6e-42))) tmp = ((60.0 * x) / (z - t)) + (a * 120.0); else tmp = ((-60.0 / (z - t)) * y) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.52e-18], N[Not[LessEqual[x, 4.6e-42]], $MachinePrecision]], 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}\;x \leq -1.52 \cdot 10^{-18} \lor \neg \left(x \leq 4.6 \cdot 10^{-42}\right):\\
\;\;\;\;\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 x < -1.52e-18 or 4.60000000000000008e-42 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f6492.2
Applied rewrites92.2%
if -1.52e-18 < x < 4.60000000000000008e-42Initial program 99.0%
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--.f6495.8
Applied rewrites95.8%
Final simplification93.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+35) (not (<= z 7e+19))) (fma (/ (- x y) z) 60.0 (* 120.0 a)) (fma a 120.0 (* (/ (- x y) t) -60.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+35) || !(z <= 7e+19)) {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
} else {
tmp = fma(a, 120.0, (((x - y) / t) * -60.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+35) || !(z <= 7e+19)) tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); else tmp = fma(a, 120.0, Float64(Float64(Float64(x - y) / t) * -60.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+35], N[Not[LessEqual[z, 7e+19]], $MachinePrecision]], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+35} \lor \neg \left(z \leq 7 \cdot 10^{+19}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{t} \cdot -60\right)\\
\end{array}
\end{array}
if z < -1.0999999999999999e35 or 7e19 < z Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6491.5
Applied rewrites91.5%
if -1.0999999999999999e35 < z < 7e19Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.2
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%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6486.3
Applied rewrites86.3%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+35) (not (<= z 7e+19))) (fma (/ (- x y) z) 60.0 (* 120.0 a)) (fma (/ (- x y) t) -60.0 (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+35) || !(z <= 7e+19)) {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
} else {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+35) || !(z <= 7e+19)) tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); else tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+35], N[Not[LessEqual[z, 7e+19]], $MachinePrecision]], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+35} \lor \neg \left(z \leq 7 \cdot 10^{+19}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\end{array}
\end{array}
if z < -1.0999999999999999e35 or 7e19 < z Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6491.5
Applied rewrites91.5%
if -1.0999999999999999e35 < z < 7e19Initial program 99.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6486.3
Applied rewrites86.3%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+35) (not (<= z 3.2e+20))) (fma a 120.0 (* (/ x z) 60.0)) (fma (/ (- x y) t) -60.0 (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+35) || !(z <= 3.2e+20)) {
tmp = fma(a, 120.0, ((x / z) * 60.0));
} else {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+35) || !(z <= 3.2e+20)) tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); else tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+35], N[Not[LessEqual[z, 3.2e+20]], $MachinePrecision]], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+35} \lor \neg \left(z \leq 3.2 \cdot 10^{+20}\right):\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\end{array}
\end{array}
if z < -1.0999999999999999e35 or 3.2e20 < z Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6491.5
Applied rewrites91.5%
Taylor expanded in x around inf
Applied rewrites83.8%
Applied rewrites83.8%
if -1.0999999999999999e35 < z < 3.2e20Initial program 99.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6486.3
Applied rewrites86.3%
Final simplification85.2%
(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.4
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-*.f6456.6
Applied rewrites56.6%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
herbie shell --seed 2024302
(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)))