
(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 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.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%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+90)
(* (/ (- x y) z) 60.0)
(if (<= t_1 4e+40)
(* 120.0 a)
(if (<= t_1 1e+177)
(fma a 120.0 (* -60.0 (/ y z)))
(* (/ (- y x) t) 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 <= -1e+90) {
tmp = ((x - y) / z) * 60.0;
} else if (t_1 <= 4e+40) {
tmp = 120.0 * a;
} else if (t_1 <= 1e+177) {
tmp = fma(a, 120.0, (-60.0 * (y / z)));
} else {
tmp = ((y - x) / t) * 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 <= -1e+90) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (t_1 <= 4e+40) tmp = Float64(120.0 * a); elseif (t_1 <= 1e+177) tmp = fma(a, 120.0, Float64(-60.0 * Float64(y / z))); else tmp = Float64(Float64(Float64(y - x) / t) * 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, -1e+90], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 4e+40], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$1, 1e+177], N[(a * 120.0 + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / t), $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 -1 \cdot 10^{+90}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+40}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_1 \leq 10^{+177}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, -60 \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{t} \cdot 60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999966e89Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6471.9
Applied rewrites71.9%
Taylor expanded in z around 0
Applied rewrites59.0%
if -9.99999999999999966e89 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.00000000000000012e40Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6473.1
Applied rewrites73.1%
if 4.00000000000000012e40 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e177Initial program 99.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6469.3
Applied rewrites69.3%
Taylor expanded in x around 0
Applied rewrites61.7%
Applied rewrites61.7%
if 1e177 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6499.6
Applied rewrites99.6%
Taylor expanded in z around 0
Applied rewrites66.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+90)
(* (/ (- x y) z) 60.0)
(if (<= t_1 1e+60) (* 120.0 a) (/ (* -60.0 y) (- 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+90) {
tmp = ((x - y) / z) * 60.0;
} else if (t_1 <= 1e+60) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 * y) / (z - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+90)) then
tmp = ((x - y) / z) * 60.0d0
else if (t_1 <= 1d+60) then
tmp = 120.0d0 * a
else
tmp = ((-60.0d0) * y) / (z - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+90) {
tmp = ((x - y) / z) * 60.0;
} else if (t_1 <= 1e+60) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 * y) / (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+90: tmp = ((x - y) / z) * 60.0 elif t_1 <= 1e+60: tmp = 120.0 * a else: tmp = (-60.0 * y) / (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+90) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (t_1 <= 1e+60) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 * y) / 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+90) tmp = ((x - y) / z) * 60.0; elseif (t_1 <= 1e+60) tmp = 120.0 * a; else tmp = (-60.0 * y) / (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+90], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+60], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 * y), $MachinePrecision] / N[(z - 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^{+90}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;t\_1 \leq 10^{+60}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999966e89Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6471.9
Applied rewrites71.9%
Taylor expanded in z around 0
Applied rewrites59.0%
if -9.99999999999999966e89 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999995e59Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6473.1
Applied rewrites73.1%
if 9.9999999999999995e59 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.8
Applied rewrites56.8%
Taylor expanded in x around inf
Applied rewrites16.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6451.9
Applied rewrites51.9%
Applied rewrites52.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+90)
(* (/ (- x y) z) 60.0)
(if (<= t_1 1e+60) (* 120.0 a) (* (/ y (- z t)) -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 <= -1e+90) {
tmp = ((x - y) / z) * 60.0;
} else if (t_1 <= 1e+60) {
tmp = 120.0 * a;
} else {
tmp = (y / (z - t)) * -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 <= (-1d+90)) then
tmp = ((x - y) / z) * 60.0d0
else if (t_1 <= 1d+60) then
tmp = 120.0d0 * a
else
tmp = (y / (z - t)) * (-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 <= -1e+90) {
tmp = ((x - y) / z) * 60.0;
} else if (t_1 <= 1e+60) {
tmp = 120.0 * a;
} else {
tmp = (y / (z - t)) * -60.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+90: tmp = ((x - y) / z) * 60.0 elif t_1 <= 1e+60: tmp = 120.0 * a else: tmp = (y / (z - t)) * -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 <= -1e+90) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (t_1 <= 1e+60) tmp = Float64(120.0 * a); else tmp = Float64(Float64(y / Float64(z - t)) * -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 <= -1e+90) tmp = ((x - y) / z) * 60.0; elseif (t_1 <= 1e+60) tmp = 120.0 * a; else tmp = (y / (z - t)) * -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, -1e+90], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+60], N[(120.0 * a), $MachinePrecision], N[(N[(y / N[(z - t), $MachinePrecision]), $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 -1 \cdot 10^{+90}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;t\_1 \leq 10^{+60}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999966e89Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6471.9
Applied rewrites71.9%
Taylor expanded in z around 0
Applied rewrites59.0%
if -9.99999999999999966e89 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999995e59Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6473.1
Applied rewrites73.1%
if 9.9999999999999995e59 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.5
Applied rewrites86.5%
Taylor expanded in x around 0
Applied rewrites51.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+111)
(* x (/ 60.0 z))
(if (<= t_1 1e+60) (* 120.0 a) (* (/ y (- z t)) -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+111) {
tmp = x * (60.0 / z);
} else if (t_1 <= 1e+60) {
tmp = 120.0 * a;
} else {
tmp = (y / (z - t)) * -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+111)) then
tmp = x * (60.0d0 / z)
else if (t_1 <= 1d+60) then
tmp = 120.0d0 * a
else
tmp = (y / (z - t)) * (-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+111) {
tmp = x * (60.0 / z);
} else if (t_1 <= 1e+60) {
tmp = 120.0 * a;
} else {
tmp = (y / (z - t)) * -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+111: tmp = x * (60.0 / z) elif t_1 <= 1e+60: tmp = 120.0 * a else: tmp = (y / (z - t)) * -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+111) tmp = Float64(x * Float64(60.0 / z)); elseif (t_1 <= 1e+60) tmp = Float64(120.0 * a); else tmp = Float64(Float64(y / Float64(z - t)) * -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+111) tmp = x * (60.0 / z); elseif (t_1 <= 1e+60) tmp = 120.0 * a; else tmp = (y / (z - t)) * -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+111], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+60], N[(120.0 * a), $MachinePrecision], N[(N[(y / N[(z - t), $MachinePrecision]), $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^{+111}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+60}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.99999999999999991e111Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6474.0
Applied rewrites74.0%
Taylor expanded in x around inf
Applied rewrites46.3%
Applied rewrites46.3%
if -1.99999999999999991e111 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999995e59Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6471.3
Applied rewrites71.3%
if 9.9999999999999995e59 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6486.5
Applied rewrites86.5%
Taylor expanded in x around 0
Applied rewrites51.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -5e+170) (not (<= t_1 2e+100)))
(* (/ -60.0 z) y)
(* 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+170) || !(t_1 <= 2e+100)) {
tmp = (-60.0 / z) * y;
} 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+170)) .or. (.not. (t_1 <= 2d+100))) then
tmp = ((-60.0d0) / z) * y
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+170) || !(t_1 <= 2e+100)) {
tmp = (-60.0 / z) * y;
} 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+170) or not (t_1 <= 2e+100): tmp = (-60.0 / z) * y 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+170) || !(t_1 <= 2e+100)) tmp = Float64(Float64(-60.0 / z) * y); 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+170) || ~((t_1 <= 2e+100))) tmp = (-60.0 / z) * y; 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+170], N[Not[LessEqual[t$95$1, 2e+100]], $MachinePrecision]], N[(N[(-60.0 / z), $MachinePrecision] * y), $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^{+170} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{-60}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999977e170 or 2.00000000000000003e100 < (/.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-*.f6463.0
Applied rewrites63.0%
Taylor expanded in z around 0
Applied rewrites57.9%
Taylor expanded in x around 0
Applied rewrites37.5%
if -4.99999999999999977e170 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000003e100Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6466.0
Applied rewrites66.0%
Final simplification59.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+111)
(* x (/ 60.0 z))
(if (<= t_1 2e+100) (* 120.0 a) (* (/ -60.0 z) y)))))
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+111) {
tmp = x * (60.0 / z);
} else if (t_1 <= 2e+100) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / z) * y;
}
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+111)) then
tmp = x * (60.0d0 / z)
else if (t_1 <= 2d+100) then
tmp = 120.0d0 * a
else
tmp = ((-60.0d0) / z) * y
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+111) {
tmp = x * (60.0 / z);
} else if (t_1 <= 2e+100) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / z) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+111: tmp = x * (60.0 / z) elif t_1 <= 2e+100: tmp = 120.0 * a else: tmp = (-60.0 / z) * y 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+111) tmp = Float64(x * Float64(60.0 / z)); elseif (t_1 <= 2e+100) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 / z) * y); 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+111) tmp = x * (60.0 / z); elseif (t_1 <= 2e+100) tmp = 120.0 * a; else tmp = (-60.0 / z) * y; 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+111], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+100], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 / z), $MachinePrecision] * y), $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^{+111}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+100}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{z} \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.99999999999999991e111Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6474.0
Applied rewrites74.0%
Taylor expanded in x around inf
Applied rewrites46.3%
Applied rewrites46.3%
if -1.99999999999999991e111 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000003e100Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6468.0
Applied rewrites68.0%
if 2.00000000000000003e100 < (/.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-*.f6452.2
Applied rewrites52.2%
Taylor expanded in z around 0
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites41.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+170)
(/ y (* z -0.016666666666666666))
(if (<= t_1 2e+100) (* 120.0 a) (* (/ -60.0 z) y)))))
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+170) {
tmp = y / (z * -0.016666666666666666);
} else if (t_1 <= 2e+100) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / z) * y;
}
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+170)) then
tmp = y / (z * (-0.016666666666666666d0))
else if (t_1 <= 2d+100) then
tmp = 120.0d0 * a
else
tmp = ((-60.0d0) / z) * y
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+170) {
tmp = y / (z * -0.016666666666666666);
} else if (t_1 <= 2e+100) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / z) * y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e+170: tmp = y / (z * -0.016666666666666666) elif t_1 <= 2e+100: tmp = 120.0 * a else: tmp = (-60.0 / z) * y 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+170) tmp = Float64(y / Float64(z * -0.016666666666666666)); elseif (t_1 <= 2e+100) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 / z) * y); 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+170) tmp = y / (z * -0.016666666666666666); elseif (t_1 <= 2e+100) tmp = 120.0 * a; else tmp = (-60.0 / z) * y; 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+170], N[(y / N[(z * -0.016666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+100], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 / z), $MachinePrecision] * y), $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^{+170}:\\
\;\;\;\;\frac{y}{z \cdot -0.016666666666666666}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+100}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{z} \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999977e170Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in z around 0
Applied rewrites69.7%
Taylor expanded in x around 0
Applied rewrites31.3%
Applied rewrites31.4%
if -4.99999999999999977e170 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000003e100Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6466.0
Applied rewrites66.0%
if 2.00000000000000003e100 < (/.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-*.f6452.2
Applied rewrites52.2%
Taylor expanded in z around 0
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites41.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -1e-43) (not (<= (* a 120.0) 5e+67))) (* 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 * 120.0) <= -1e-43) || !((a * 120.0) <= 5e+67)) {
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 * 120.0d0) <= (-1d-43)) .or. (.not. ((a * 120.0d0) <= 5d+67))) 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 * 120.0) <= -1e-43) || !((a * 120.0) <= 5e+67)) {
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 * 120.0) <= -1e-43) or not ((a * 120.0) <= 5e+67): 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 ((Float64(a * 120.0) <= -1e-43) || !(Float64(a * 120.0) <= 5e+67)) 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 * 120.0) <= -1e-43) || ~(((a * 120.0) <= 5e+67))) 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[N[(a * 120.0), $MachinePrecision], -1e-43], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e+67]], $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 \cdot 120 \leq -1 \cdot 10^{-43} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{+67}\right):\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1.00000000000000008e-43 or 4.99999999999999976e67 < (*.f64 a #s(literal 120 binary64)) Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6478.6
Applied rewrites78.6%
if -1.00000000000000008e-43 < (*.f64 a #s(literal 120 binary64)) < 4.99999999999999976e67Initial program 99.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.1
Applied rewrites80.1%
Applied rewrites80.2%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -2e-70) (fma a 120.0 (* (/ x z) 60.0)) (if (<= (* a 120.0) 5e+67) (* (- 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 * 120.0) <= -2e-70) {
tmp = fma(a, 120.0, ((x / z) * 60.0));
} else if ((a * 120.0) <= 5e+67) {
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 (Float64(a * 120.0) <= -2e-70) tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); elseif (Float64(a * 120.0) <= 5e+67) 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[N[(a * 120.0), $MachinePrecision], -2e-70], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 5e+67], 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 \cdot 120 \leq -2 \cdot 10^{-70}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{elif}\;a \cdot 120 \leq 5 \cdot 10^{+67}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1.99999999999999999e-70Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in x around inf
Applied rewrites81.9%
Applied rewrites81.9%
if -1.99999999999999999e-70 < (*.f64 a #s(literal 120 binary64)) < 4.99999999999999976e67Initial program 99.6%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6480.4
Applied rewrites80.4%
Applied rewrites80.5%
if 4.99999999999999976e67 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6483.3
Applied rewrites83.3%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (* 60.0 (- x y)) (- z t)) 1e+177) (* 120.0 a) (* (/ y t) 60.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((60.0 * (x - y)) / (z - t)) <= 1e+177) {
tmp = 120.0 * a;
} else {
tmp = (y / t) * 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) :: tmp
if (((60.0d0 * (x - y)) / (z - t)) <= 1d+177) then
tmp = 120.0d0 * a
else
tmp = (y / t) * 60.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((60.0 * (x - y)) / (z - t)) <= 1e+177) {
tmp = 120.0 * a;
} else {
tmp = (y / t) * 60.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((60.0 * (x - y)) / (z - t)) <= 1e+177: tmp = 120.0 * a else: tmp = (y / t) * 60.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) <= 1e+177) tmp = Float64(120.0 * a); else tmp = Float64(Float64(y / t) * 60.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((60.0 * (x - y)) / (z - t)) <= 1e+177) tmp = 120.0 * a; else tmp = (y / t) * 60.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], 1e+177], N[(120.0 * a), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 60.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{60 \cdot \left(x - y\right)}{z - t} \leq 10^{+177}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e177Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6458.0
Applied rewrites58.0%
if 1e177 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6448.7
Applied rewrites48.7%
Taylor expanded in x around inf
Applied rewrites17.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6459.9
Applied rewrites59.9%
Taylor expanded in z around 0
Applied rewrites34.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.4e+104) (not (<= x 4e+147))) (+ (/ (* 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 <= -2.4e+104) || !(x <= 4e+147)) {
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 <= (-2.4d+104)) .or. (.not. (x <= 4d+147))) 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 <= -2.4e+104) || !(x <= 4e+147)) {
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 <= -2.4e+104) or not (x <= 4e+147): 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 <= -2.4e+104) || !(x <= 4e+147)) 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 <= -2.4e+104) || ~((x <= 4e+147))) 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, -2.4e+104], N[Not[LessEqual[x, 4e+147]], $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 -2.4 \cdot 10^{+104} \lor \neg \left(x \leq 4 \cdot 10^{+147}\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 < -2.4e104 or 3.9999999999999999e147 < x Initial program 99.6%
Taylor expanded in x around inf
lower-*.f6491.3
Applied rewrites91.3%
if -2.4e104 < x < 3.9999999999999999e147Initial program 99.8%
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--.f6493.8
Applied rewrites93.8%
Final simplification93.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e-56) (not (<= t 890000000.0))) (fma a 120.0 (* (/ -60.0 t) (- x y))) (fma a 120.0 (* (/ 60.0 z) (- x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e-56) || !(t <= 890000000.0)) {
tmp = fma(a, 120.0, ((-60.0 / t) * (x - y)));
} else {
tmp = fma(a, 120.0, ((60.0 / z) * (x - y)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e-56) || !(t <= 890000000.0)) tmp = fma(a, 120.0, Float64(Float64(-60.0 / t) * Float64(x - y))); else tmp = fma(a, 120.0, Float64(Float64(60.0 / z) * Float64(x - y))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.6e-56], N[Not[LessEqual[t, 890000000.0]], $MachinePrecision]], N[(a * 120.0 + N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(60.0 / z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-56} \lor \neg \left(t \leq 890000000\right):\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{t} \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{z} \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if t < -3.59999999999999978e-56 or 8.9e8 < t Initial 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.8
Applied rewrites99.8%
Taylor expanded in z around 0
lower-/.f6486.4
Applied rewrites86.4%
if -3.59999999999999978e-56 < t < 8.9e8Initial 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 inf
lower-/.f6488.3
Applied rewrites88.3%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e-56) (not (<= t 890000000.0))) (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 <= -3.6e-56) || !(t <= 890000000.0)) {
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 <= -3.6e-56) || !(t <= 890000000.0)) 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, -3.6e-56], N[Not[LessEqual[t, 890000000.0]], $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 -3.6 \cdot 10^{-56} \lor \neg \left(t \leq 890000000\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 < -3.59999999999999978e-56 or 8.9e8 < t Initial 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.8
Applied rewrites99.8%
Taylor expanded in z around 0
lower-/.f6486.4
Applied rewrites86.4%
if -3.59999999999999978e-56 < t < 8.9e8Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6488.3
Applied rewrites88.3%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e-56) (not (<= t 890000000.0))) (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 <= -3.6e-56) || !(t <= 890000000.0)) {
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 <= -3.6e-56) || !(t <= 890000000.0)) 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, -3.6e-56], N[Not[LessEqual[t, 890000000.0]], $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 -3.6 \cdot 10^{-56} \lor \neg \left(t \leq 890000000\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 < -3.59999999999999978e-56 or 8.9e8 < t Initial program 99.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6486.4
Applied rewrites86.4%
if -3.59999999999999978e-56 < t < 8.9e8Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6488.3
Applied rewrites88.3%
Final simplification87.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.1e-56)
(+ (* (/ -60.0 (- z t)) y) (* a 120.0))
(if (<= t 890000000.0)
(fma a 120.0 (* (/ 60.0 z) (- x y)))
(fma a 120.0 (* (/ -60.0 t) (- x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e-56) {
tmp = ((-60.0 / (z - t)) * y) + (a * 120.0);
} else if (t <= 890000000.0) {
tmp = fma(a, 120.0, ((60.0 / z) * (x - y)));
} else {
tmp = fma(a, 120.0, ((-60.0 / t) * (x - y)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e-56) tmp = Float64(Float64(Float64(-60.0 / Float64(z - t)) * y) + Float64(a * 120.0)); elseif (t <= 890000000.0) tmp = fma(a, 120.0, Float64(Float64(60.0 / z) * Float64(x - y))); else tmp = fma(a, 120.0, Float64(Float64(-60.0 / t) * Float64(x - y))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e-56], N[(N[(N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 890000000.0], N[(a * 120.0 + N[(N[(60.0 / z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-56}:\\
\;\;\;\;\frac{-60}{z - t} \cdot y + a \cdot 120\\
\mathbf{elif}\;t \leq 890000000:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{z} \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{t} \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if t < -3.09999999999999987e-56Initial program 99.6%
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--.f6480.1
Applied rewrites80.1%
if -3.09999999999999987e-56 < t < 8.9e8Initial 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 inf
lower-/.f6488.3
Applied rewrites88.3%
if 8.9e8 < t Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
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-/.f6494.4
Applied rewrites94.4%
Final simplification87.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.6e-56)
(fma a 120.0 (/ (- x y) (* -0.016666666666666666 t)))
(if (<= t 890000000.0)
(fma a 120.0 (* (/ 60.0 z) (- x y)))
(fma a 120.0 (* (/ -60.0 t) (- x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.6e-56) {
tmp = fma(a, 120.0, ((x - y) / (-0.016666666666666666 * t)));
} else if (t <= 890000000.0) {
tmp = fma(a, 120.0, ((60.0 / z) * (x - y)));
} else {
tmp = fma(a, 120.0, ((-60.0 / t) * (x - y)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.6e-56) tmp = fma(a, 120.0, Float64(Float64(x - y) / Float64(-0.016666666666666666 * t))); elseif (t <= 890000000.0) tmp = fma(a, 120.0, Float64(Float64(60.0 / z) * Float64(x - y))); else tmp = fma(a, 120.0, Float64(Float64(-60.0 / t) * Float64(x - y))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.6e-56], N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(-0.016666666666666666 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 890000000.0], N[(a * 120.0 + N[(N[(60.0 / z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-56}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{-0.016666666666666666 \cdot t}\right)\\
\mathbf{elif}\;t \leq 890000000:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{z} \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{t} \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if t < -3.59999999999999978e-56Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.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.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%
Taylor expanded in z around 0
lower-*.f6478.9
Applied rewrites78.9%
if -3.59999999999999978e-56 < t < 8.9e8Initial 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 inf
lower-/.f6488.3
Applied rewrites88.3%
if 8.9e8 < t Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
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-/.f6494.4
Applied rewrites94.4%
(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.7%
Taylor expanded in z around inf
lower-*.f6452.3
Applied rewrites52.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 2024324
(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)))