
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ 60.0 (- z t)) (- x y) (* 120.0 a)))
double code(double x, double y, double z, double t, double a) {
return fma((60.0 / (z - t)), (x - y), (120.0 * a));
}
function code(x, y, z, t, a) return fma(Float64(60.0 / Float64(z - t)), Float64(x - y), Float64(120.0 * a)) end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{60}{z - t}, x - y, 120 \cdot a\right)
\end{array}
Initial program 99.5%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+142)
(* (- x y) (/ 60.0 z))
(if (<= t_1 6e-15)
(* 120.0 a)
(if (<= t_1 2e+113)
(fma y (/ -60.0 z) (* a 120.0))
(* (- x y) (/ -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 <= -2e+142) {
tmp = (x - y) * (60.0 / z);
} else if (t_1 <= 6e-15) {
tmp = 120.0 * a;
} else if (t_1 <= 2e+113) {
tmp = fma(y, (-60.0 / z), (a * 120.0));
} else {
tmp = (x - y) * (-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 <= -2e+142) tmp = Float64(Float64(x - y) * Float64(60.0 / z)); elseif (t_1 <= 6e-15) tmp = Float64(120.0 * a); elseif (t_1 <= 2e+113) tmp = fma(y, Float64(-60.0 / z), Float64(a * 120.0)); else tmp = Float64(Float64(x - y) * Float64(-60.0 / t)); 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+142], N[(N[(x - y), $MachinePrecision] * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 6e-15], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$1, 2e+113], N[(y * N[(-60.0 / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * 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 -2 \cdot 10^{+142}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\
\mathbf{elif}\;t\_1 \leq 6 \cdot 10^{-15}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+113}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-60}{z}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.0000000000000001e142Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6489.9
Applied rewrites89.9%
Taylor expanded in z around inf
Applied rewrites62.2%
if -2.0000000000000001e142 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 6e-15Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6470.1
Applied rewrites70.1%
if 6e-15 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e113Initial program 99.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.8
Applied rewrites62.8%
Taylor expanded in x around 0
Applied rewrites55.9%
Applied rewrites56.0%
if 2e113 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.2%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6494.3
Applied rewrites94.3%
Taylor expanded in z around 0
Applied rewrites58.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+142)
(* (- x y) (/ 60.0 z))
(if (<= t_1 2e+113) (* 120.0 a) (* (- x y) (/ -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 <= -2e+142) {
tmp = (x - y) * (60.0 / z);
} else if (t_1 <= 2e+113) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (-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 <= (-2d+142)) then
tmp = (x - y) * (60.0d0 / z)
else if (t_1 <= 2d+113) then
tmp = 120.0d0 * a
else
tmp = (x - y) * ((-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 <= -2e+142) {
tmp = (x - y) * (60.0 / z);
} else if (t_1 <= 2e+113) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (-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 <= -2e+142: tmp = (x - y) * (60.0 / z) elif t_1 <= 2e+113: tmp = 120.0 * a else: tmp = (x - y) * (-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 <= -2e+142) tmp = Float64(Float64(x - y) * Float64(60.0 / z)); elseif (t_1 <= 2e+113) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x - y) * 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 <= -2e+142) tmp = (x - y) * (60.0 / z); elseif (t_1 <= 2e+113) tmp = 120.0 * a; else tmp = (x - y) * (-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, -2e+142], N[(N[(x - y), $MachinePrecision] * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+113], N[(120.0 * a), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * 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 -2 \cdot 10^{+142}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+113}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.0000000000000001e142Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6489.9
Applied rewrites89.9%
Taylor expanded in z around inf
Applied rewrites62.2%
if -2.0000000000000001e142 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e113Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6465.5
Applied rewrites65.5%
if 2e113 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.2%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6494.3
Applied rewrites94.3%
Taylor expanded in z around 0
Applied rewrites58.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+199)
(* x (/ 60.0 z))
(if (<= t_1 5e+137) (* 120.0 a) (* (- y) (/ -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 <= -5e+199) {
tmp = x * (60.0 / z);
} else if (t_1 <= 5e+137) {
tmp = 120.0 * a;
} else {
tmp = -y * (-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 <= (-5d+199)) then
tmp = x * (60.0d0 / z)
else if (t_1 <= 5d+137) then
tmp = 120.0d0 * a
else
tmp = -y * ((-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 <= -5e+199) {
tmp = x * (60.0 / z);
} else if (t_1 <= 5e+137) {
tmp = 120.0 * a;
} else {
tmp = -y * (-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 <= -5e+199: tmp = x * (60.0 / z) elif t_1 <= 5e+137: tmp = 120.0 * a else: tmp = -y * (-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 <= -5e+199) tmp = Float64(x * Float64(60.0 / z)); elseif (t_1 <= 5e+137) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-y) * 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 <= -5e+199) tmp = x * (60.0 / z); elseif (t_1 <= 5e+137) tmp = 120.0 * a; else tmp = -y * (-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, -5e+199], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+137], N[(120.0 * a), $MachinePrecision], N[((-y) * 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 -5 \cdot 10^{+199}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+137}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999998e199Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Taylor expanded in x around inf
Applied rewrites41.4%
Applied rewrites41.5%
if -4.9999999999999998e199 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.0000000000000002e137Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6463.1
Applied rewrites63.1%
if 5.0000000000000002e137 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 96.9%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6493.7
Applied rewrites93.7%
Taylor expanded in z around 0
Applied rewrites59.3%
Taylor expanded in x around 0
Applied rewrites38.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -5e+199) (not (<= t_1 1e+111)))
(* x (/ 60.0 z))
(* 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+199) || !(t_1 <= 1e+111)) {
tmp = x * (60.0 / z);
} 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+199)) .or. (.not. (t_1 <= 1d+111))) then
tmp = x * (60.0d0 / z)
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+199) || !(t_1 <= 1e+111)) {
tmp = x * (60.0 / z);
} 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+199) or not (t_1 <= 1e+111): tmp = x * (60.0 / z) 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+199) || !(t_1 <= 1e+111)) tmp = Float64(x * Float64(60.0 / z)); 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+199) || ~((t_1 <= 1e+111))) tmp = x * (60.0 / z); 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+199], N[Not[LessEqual[t$95$1, 1e+111]], $MachinePrecision]], N[(x * N[(60.0 / z), $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 -5 \cdot 10^{+199} \lor \neg \left(t\_1 \leq 10^{+111}\right):\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999998e199 or 9.99999999999999957e110 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.3
Applied rewrites56.3%
Taylor expanded in x around inf
Applied rewrites32.2%
Applied rewrites32.2%
if -4.9999999999999998e199 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999957e110Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6465.0
Applied rewrites65.0%
Final simplification57.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+199)
(* x (/ 60.0 z))
(if (<= t_1 1e+111) (* 120.0 a) (* (/ 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 <= -5e+199) {
tmp = x * (60.0 / z);
} else if (t_1 <= 1e+111) {
tmp = 120.0 * a;
} else {
tmp = (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 <= (-5d+199)) then
tmp = x * (60.0d0 / z)
else if (t_1 <= 1d+111) then
tmp = 120.0d0 * a
else
tmp = (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 <= -5e+199) {
tmp = x * (60.0 / z);
} else if (t_1 <= 1e+111) {
tmp = 120.0 * a;
} else {
tmp = (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 <= -5e+199: tmp = x * (60.0 / z) elif t_1 <= 1e+111: tmp = 120.0 * a else: tmp = (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 <= -5e+199) tmp = Float64(x * Float64(60.0 / z)); elseif (t_1 <= 1e+111) tmp = Float64(120.0 * a); else tmp = Float64(Float64(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 <= -5e+199) tmp = x * (60.0 / z); elseif (t_1 <= 1e+111) tmp = 120.0 * a; else tmp = (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, -5e+199], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+111], N[(120.0 * a), $MachinePrecision], N[(N[(y / 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 -5 \cdot 10^{+199}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+111}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot -60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999998e199Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Taylor expanded in x around inf
Applied rewrites41.4%
Applied rewrites41.5%
if -4.9999999999999998e199 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999957e110Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6465.0
Applied rewrites65.0%
if 9.99999999999999957e110 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6450.3
Applied rewrites50.3%
Taylor expanded in y around inf
Applied rewrites30.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+199)
(* x (/ 60.0 z))
(if (<= t_1 1e+111) (* 120.0 a) (* (/ x 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 <= -5e+199) {
tmp = x * (60.0 / z);
} else if (t_1 <= 1e+111) {
tmp = 120.0 * a;
} else {
tmp = (x / 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 <= (-5d+199)) then
tmp = x * (60.0d0 / z)
else if (t_1 <= 1d+111) then
tmp = 120.0d0 * a
else
tmp = (x / 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 <= -5e+199) {
tmp = x * (60.0 / z);
} else if (t_1 <= 1e+111) {
tmp = 120.0 * a;
} else {
tmp = (x / 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 <= -5e+199: tmp = x * (60.0 / z) elif t_1 <= 1e+111: tmp = 120.0 * a else: tmp = (x / 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 <= -5e+199) tmp = Float64(x * Float64(60.0 / z)); elseif (t_1 <= 1e+111) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x / 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 <= -5e+199) tmp = x * (60.0 / z); elseif (t_1 <= 1e+111) tmp = 120.0 * a; else tmp = (x / 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, -5e+199], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+111], N[(120.0 * a), $MachinePrecision], N[(N[(x / 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 -5 \cdot 10^{+199}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+111}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot 60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999998e199Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Taylor expanded in x around inf
Applied rewrites41.4%
Applied rewrites41.5%
if -4.9999999999999998e199 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999957e110Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6465.0
Applied rewrites65.0%
if 9.99999999999999957e110 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6450.3
Applied rewrites50.3%
Taylor expanded in x around inf
Applied rewrites26.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.6e-145)
(fma (/ -60.0 t) (- x y) (* 120.0 a))
(if (<= t 3.6e-79)
(fma (/ 60.0 z) (- x y) (* 120.0 a))
(if (<= t 5e+80)
(+ (/ (* -60.0 y) (- z t)) (* a 120.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 (t <= -1.6e-145) {
tmp = fma((-60.0 / t), (x - y), (120.0 * a));
} else if (t <= 3.6e-79) {
tmp = fma((60.0 / z), (x - y), (120.0 * a));
} else if (t <= 5e+80) {
tmp = ((-60.0 * y) / (z - t)) + (a * 120.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 (t <= -1.6e-145) tmp = fma(Float64(-60.0 / t), Float64(x - y), Float64(120.0 * a)); elseif (t <= 3.6e-79) tmp = fma(Float64(60.0 / z), Float64(x - y), Float64(120.0 * a)); elseif (t <= 5e+80) tmp = Float64(Float64(Float64(-60.0 * y) / Float64(z - t)) + Float64(a * 120.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[LessEqual[t, -1.6e-145], N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e-79], N[(N[(60.0 / z), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+80], N[(N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.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}\;t \leq -1.6 \cdot 10^{-145}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-60}{t}, x - y, 120 \cdot a\right)\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(\frac{60}{z}, x - y, 120 \cdot a\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+80}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -1.60000000000000004e-145Initial program 99.9%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6482.5
Applied rewrites82.5%
if -1.60000000000000004e-145 < t < 3.6000000000000002e-79Initial program 98.7%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6490.0
Applied rewrites90.0%
if 3.6000000000000002e-79 < t < 4.99999999999999961e80Initial program 99.8%
Taylor expanded in x around 0
lower-*.f6486.1
Applied rewrites86.1%
if 4.99999999999999961e80 < t Initial program 99.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6496.0
Applied rewrites96.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -9.5e-104)
(fma (/ x z) 60.0 (* 120.0 a))
(if (<= a 5.4e-39)
(* (- x y) (/ 60.0 (- z t)))
(if (<= a 1.85e-12)
(fma y (/ -60.0 z) (* a 120.0))
(fma (/ -60.0 t) (- y) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e-104) {
tmp = fma((x / z), 60.0, (120.0 * a));
} else if (a <= 5.4e-39) {
tmp = (x - y) * (60.0 / (z - t));
} else if (a <= 1.85e-12) {
tmp = fma(y, (-60.0 / z), (a * 120.0));
} else {
tmp = fma((-60.0 / t), -y, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e-104) tmp = fma(Float64(x / z), 60.0, Float64(120.0 * a)); elseif (a <= 5.4e-39) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); elseif (a <= 1.85e-12) tmp = fma(y, Float64(-60.0 / z), Float64(a * 120.0)); else tmp = fma(Float64(-60.0 / t), Float64(-y), Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e-104], N[(N[(x / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.4e-39], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e-12], N[(y * N[(-60.0 / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(-60.0 / t), $MachinePrecision] * (-y) + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{-104}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, 60, 120 \cdot a\right)\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{-39}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-60}{z}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-60}{t}, -y, 120 \cdot a\right)\\
\end{array}
\end{array}
if a < -9.5000000000000002e-104Initial program 99.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6473.0
Applied rewrites73.0%
Taylor expanded in x around inf
Applied rewrites75.0%
if -9.5000000000000002e-104 < a < 5.4000000000000001e-39Initial program 98.8%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6482.6
Applied rewrites82.6%
if 5.4000000000000001e-39 < a < 1.84999999999999999e-12Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6467.7
Applied rewrites67.7%
Taylor expanded in x around 0
Applied rewrites89.5%
Applied rewrites89.8%
if 1.84999999999999999e-12 < a Initial program 99.9%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6476.4
Applied rewrites76.4%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f6483.0
Applied rewrites83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.8e-21) (not (<= y 125000000000.0))) (+ (/ (* -60.0 y) (- z t)) (* a 120.0)) (+ (/ (* 60.0 x) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.8e-21) || !(y <= 125000000000.0)) {
tmp = ((-60.0 * y) / (z - t)) + (a * 120.0);
} else {
tmp = ((60.0 * x) / (z - t)) + (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 ((y <= (-2.8d-21)) .or. (.not. (y <= 125000000000.0d0))) then
tmp = (((-60.0d0) * y) / (z - t)) + (a * 120.0d0)
else
tmp = ((60.0d0 * x) / (z - t)) + (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 ((y <= -2.8e-21) || !(y <= 125000000000.0)) {
tmp = ((-60.0 * y) / (z - t)) + (a * 120.0);
} else {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.8e-21) or not (y <= 125000000000.0): tmp = ((-60.0 * y) / (z - t)) + (a * 120.0) else: tmp = ((60.0 * x) / (z - t)) + (a * 120.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.8e-21) || !(y <= 125000000000.0)) tmp = Float64(Float64(Float64(-60.0 * y) / Float64(z - t)) + Float64(a * 120.0)); else tmp = Float64(Float64(Float64(60.0 * x) / Float64(z - t)) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.8e-21) || ~((y <= 125000000000.0))) tmp = ((-60.0 * y) / (z - t)) + (a * 120.0); else tmp = ((60.0 * x) / (z - t)) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.8e-21], N[Not[LessEqual[y, 125000000000.0]], $MachinePrecision]], N[(N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-21} \lor \neg \left(y \leq 125000000000\right):\\
\;\;\;\;\frac{-60 \cdot y}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot x}{z - t} + a \cdot 120\\
\end{array}
\end{array}
if y < -2.80000000000000004e-21 or 1.25e11 < y Initial program 99.8%
Taylor expanded in x around 0
lower-*.f6484.0
Applied rewrites84.0%
if -2.80000000000000004e-21 < y < 1.25e11Initial program 99.1%
Taylor expanded in x around inf
lower-*.f6497.1
Applied rewrites97.1%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e-145) (not (<= t 7e-17))) (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-145) || !(t <= 7e-17)) {
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-145) || !(t <= 7e-17)) 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-145], N[Not[LessEqual[t, 7e-17]], $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^{-145} \lor \neg \left(t \leq 7 \cdot 10^{-17}\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.60000000000000004e-145 or 7.0000000000000003e-17 < t Initial program 99.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6485.1
Applied rewrites85.1%
if -1.60000000000000004e-145 < t < 7.0000000000000003e-17Initial program 98.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6488.1
Applied rewrites88.1%
Final simplification86.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.6e-145)
(fma (/ -60.0 t) (- x y) (* 120.0 a))
(if (<= t 7e-17)
(fma (/ 60.0 z) (- x y) (* 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 (t <= -1.6e-145) {
tmp = fma((-60.0 / t), (x - y), (120.0 * a));
} else if (t <= 7e-17) {
tmp = fma((60.0 / z), (x - y), (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 (t <= -1.6e-145) tmp = fma(Float64(-60.0 / t), Float64(x - y), Float64(120.0 * a)); elseif (t <= 7e-17) tmp = fma(Float64(60.0 / z), Float64(x - y), 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[LessEqual[t, -1.6e-145], N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-17], N[(N[(60.0 / z), $MachinePrecision] * N[(x - y), $MachinePrecision] + 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}\;t \leq -1.6 \cdot 10^{-145}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-60}{t}, x - y, 120 \cdot a\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{60}{z}, x - y, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -1.60000000000000004e-145Initial program 99.9%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6482.5
Applied rewrites82.5%
if -1.60000000000000004e-145 < t < 7.0000000000000003e-17Initial program 98.8%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6488.2
Applied rewrites88.2%
if 7.0000000000000003e-17 < t Initial program 99.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6488.3
Applied rewrites88.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.6e-145)
(fma (/ -60.0 t) (- x y) (* 120.0 a))
(if (<= t 7e-17)
(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 (t <= -1.6e-145) {
tmp = fma((-60.0 / t), (x - y), (120.0 * a));
} else if (t <= 7e-17) {
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 (t <= -1.6e-145) tmp = fma(Float64(-60.0 / t), Float64(x - y), Float64(120.0 * a)); elseif (t <= 7e-17) 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[LessEqual[t, -1.6e-145], N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-17], 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}\;t \leq -1.6 \cdot 10^{-145}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-60}{t}, x - y, 120 \cdot a\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-17}:\\
\;\;\;\;\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 t < -1.60000000000000004e-145Initial program 99.9%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
lower-/.f6482.5
Applied rewrites82.5%
if -1.60000000000000004e-145 < t < 7.0000000000000003e-17Initial program 98.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6488.1
Applied rewrites88.1%
if 7.0000000000000003e-17 < t Initial program 99.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6488.3
Applied rewrites88.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.65e-45)
(fma y (/ -60.0 z) (* a 120.0))
(if (<= z 1.05e-137)
(fma (/ (- x y) t) -60.0 (* 120.0 a))
(fma (/ x z) 60.0 (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.65e-45) {
tmp = fma(y, (-60.0 / z), (a * 120.0));
} else if (z <= 1.05e-137) {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
} else {
tmp = fma((x / z), 60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.65e-45) tmp = fma(y, Float64(-60.0 / z), Float64(a * 120.0)); elseif (z <= 1.05e-137) tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); else tmp = fma(Float64(x / z), 60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.65e-45], N[(y * N[(-60.0 / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-137], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-60}{z}, a \cdot 120\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-137}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, 60, 120 \cdot a\right)\\
\end{array}
\end{array}
if z < -2.6499999999999999e-45Initial program 98.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6482.6
Applied rewrites82.6%
Taylor expanded in x around 0
Applied rewrites74.3%
Applied rewrites74.4%
if -2.6499999999999999e-45 < z < 1.04999999999999996e-137Initial program 99.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6489.7
Applied rewrites89.7%
if 1.04999999999999996e-137 < z Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6480.7
Applied rewrites80.7%
Taylor expanded in x around inf
Applied rewrites73.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.4e-47) (not (<= a 5.2e-39))) (* 120.0 a) (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.4e-47) || !(a <= 5.2e-39)) {
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) :: tmp
if ((a <= (-2.4d-47)) .or. (.not. (a <= 5.2d-39))) 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 tmp;
if ((a <= -2.4e-47) || !(a <= 5.2e-39)) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.4e-47) or not (a <= 5.2e-39): tmp = 120.0 * a else: tmp = (x - y) * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.4e-47) || !(a <= 5.2e-39)) 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) tmp = 0.0; if ((a <= -2.4e-47) || ~((a <= 5.2e-39))) tmp = 120.0 * a; else tmp = (x - y) * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.4e-47], N[Not[LessEqual[a, 5.2e-39]], $MachinePrecision]], 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}
\mathbf{if}\;a \leq -2.4 \cdot 10^{-47} \lor \neg \left(a \leq 5.2 \cdot 10^{-39}\right):\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if a < -2.3999999999999999e-47 or 5.2e-39 < a Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6474.7
Applied rewrites74.7%
if -2.3999999999999999e-47 < a < 5.2e-39Initial program 98.9%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6480.1
Applied rewrites80.1%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.5e-104) (fma (/ x z) 60.0 (* 120.0 a)) (if (<= a 5.2e-39) (* (- x y) (/ 60.0 (- z t))) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e-104) {
tmp = fma((x / z), 60.0, (120.0 * a));
} else if (a <= 5.2e-39) {
tmp = (x - y) * (60.0 / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e-104) tmp = fma(Float64(x / z), 60.0, Float64(120.0 * a)); elseif (a <= 5.2e-39) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e-104], N[(N[(x / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e-39], 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}
\mathbf{if}\;a \leq -9.5 \cdot 10^{-104}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, 60, 120 \cdot a\right)\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-39}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -9.5000000000000002e-104Initial program 99.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6473.0
Applied rewrites73.0%
Taylor expanded in x around inf
Applied rewrites75.0%
if -9.5000000000000002e-104 < a < 5.2e-39Initial program 98.8%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6482.6
Applied rewrites82.6%
if 5.2e-39 < a Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6475.6
Applied rewrites75.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9e+155) (not (<= y 2e+128))) (* (/ y (- z t)) -60.0) (* 120.0 a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9e+155) || !(y <= 2e+128)) {
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) :: tmp
if ((y <= (-9d+155)) .or. (.not. (y <= 2d+128))) 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 tmp;
if ((y <= -9e+155) || !(y <= 2e+128)) {
tmp = (y / (z - t)) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9e+155) or not (y <= 2e+128): tmp = (y / (z - t)) * -60.0 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9e+155) || !(y <= 2e+128)) 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) tmp = 0.0; if ((y <= -9e+155) || ~((y <= 2e+128))) tmp = (y / (z - t)) * -60.0; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9e+155], N[Not[LessEqual[y, 2e+128]], $MachinePrecision]], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+155} \lor \neg \left(y \leq 2 \cdot 10^{+128}\right):\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if y < -8.99999999999999947e155 or 2.0000000000000002e128 < y Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6481.3
Applied rewrites81.3%
Taylor expanded in x around 0
Applied rewrites66.4%
if -8.99999999999999947e155 < y < 2.0000000000000002e128Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6461.7
Applied rewrites61.7%
Final simplification62.9%
(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.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(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 2024339
(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)))