
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
Initial program 99.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+146)
(/ (* y -60.0) z)
(if (<= t_1 1e+295) (* a 120.0) (/ (* 60.0 y) 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+146) {
tmp = (y * -60.0) / z;
} else if (t_1 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = (60.0 * y) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-2d+146)) then
tmp = (y * (-60.0d0)) / z
else if (t_1 <= 1d+295) then
tmp = a * 120.0d0
else
tmp = (60.0d0 * y) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+146) {
tmp = (y * -60.0) / z;
} else if (t_1 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = (60.0 * y) / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+146: tmp = (y * -60.0) / z elif t_1 <= 1e+295: tmp = a * 120.0 else: tmp = (60.0 * y) / 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+146) tmp = Float64(Float64(y * -60.0) / z); elseif (t_1 <= 1e+295) tmp = Float64(a * 120.0); else tmp = Float64(Float64(60.0 * y) / 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+146) tmp = (y * -60.0) / z; elseif (t_1 <= 1e+295) tmp = a * 120.0; else tmp = (60.0 * y) / 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+146], N[(N[(y * -60.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+295], N[(a * 120.0), $MachinePrecision], N[(N[(60.0 * y), $MachinePrecision] / t), $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^{+146}:\\
\;\;\;\;\frac{y \cdot -60}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+295}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.99999999999999987e146Initial program 93.6%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6471.5
Applied rewrites71.5%
Taylor expanded in y around inf
Applied rewrites42.9%
if -1.99999999999999987e146 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6455.8
Applied rewrites55.8%
if 9.9999999999999998e294 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 100.0%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites83.4%
Final simplification55.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* 60.0 y) t)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -1e+136) t_1 (if (<= t_2 1e+295) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * y) / t;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+136) {
tmp = t_1;
} else if (t_2 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (60.0d0 * y) / t
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-1d+136)) then
tmp = t_1
else if (t_2 <= 1d+295) then
tmp = a * 120.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * y) / t;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+136) {
tmp = t_1;
} else if (t_2 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * y) / t t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -1e+136: tmp = t_1 elif t_2 <= 1e+295: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * y) / t) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+136) tmp = t_1; elseif (t_2 <= 1e+295) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * y) / t; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -1e+136) tmp = t_1; elseif (t_2 <= 1e+295) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+136], t$95$1, If[LessEqual[t$95$2, 1e+295], N[(a * 120.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot y}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+295}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000006e136 or 9.9999999999999998e294 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
Taylor expanded in y around inf
Applied rewrites38.2%
if -1.00000000000000006e136 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6457.1
Applied rewrites57.1%
Final simplification53.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+136)
(/ y (* t 0.016666666666666666))
(if (<= t_1 1e+295) (* a 120.0) (* 60.0 (/ y 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+136) {
tmp = y / (t * 0.016666666666666666);
} else if (t_1 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+136)) then
tmp = y / (t * 0.016666666666666666d0)
else if (t_1 <= 1d+295) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+136) {
tmp = y / (t * 0.016666666666666666);
} else if (t_1 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+136: tmp = y / (t * 0.016666666666666666) elif t_1 <= 1e+295: tmp = a * 120.0 else: tmp = 60.0 * (y / 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+136) tmp = Float64(y / Float64(t * 0.016666666666666666)); elseif (t_1 <= 1e+295) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+136) tmp = y / (t * 0.016666666666666666); elseif (t_1 <= 1e+295) tmp = a * 120.0; else tmp = 60.0 * (y / 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+136], N[(y / N[(t * 0.016666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+295], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / 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^{+136}:\\
\;\;\;\;\frac{y}{t \cdot 0.016666666666666666}\\
\mathbf{elif}\;t\_1 \leq 10^{+295}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000006e136Initial program 94.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6442.3
Applied rewrites42.3%
Taylor expanded in y around inf
Applied rewrites23.2%
Applied rewrites23.1%
Applied rewrites23.2%
if -1.00000000000000006e136 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6457.1
Applied rewrites57.1%
if 9.9999999999999998e294 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 100.0%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites83.4%
Applied rewrites83.4%
Final simplification53.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+136)
(* y (/ 60.0 t))
(if (<= t_1 1e+295) (* a 120.0) (* 60.0 (/ y 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+136) {
tmp = y * (60.0 / t);
} else if (t_1 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+136)) then
tmp = y * (60.0d0 / t)
else if (t_1 <= 1d+295) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+136) {
tmp = y * (60.0 / t);
} else if (t_1 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+136: tmp = y * (60.0 / t) elif t_1 <= 1e+295: tmp = a * 120.0 else: tmp = 60.0 * (y / 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+136) tmp = Float64(y * Float64(60.0 / t)); elseif (t_1 <= 1e+295) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+136) tmp = y * (60.0 / t); elseif (t_1 <= 1e+295) tmp = a * 120.0; else tmp = 60.0 * (y / 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+136], N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+295], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / 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^{+136}:\\
\;\;\;\;y \cdot \frac{60}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{+295}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000006e136Initial program 94.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6442.3
Applied rewrites42.3%
Taylor expanded in y around inf
Applied rewrites23.2%
Applied rewrites23.2%
if -1.00000000000000006e136 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6457.1
Applied rewrites57.1%
if 9.9999999999999998e294 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 100.0%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites83.4%
Applied rewrites83.4%
Final simplification53.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ y t))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -1e+136) t_1 (if (<= t_2 1e+295) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (y / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+136) {
tmp = t_1;
} else if (t_2 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 60.0d0 * (y / t)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-1d+136)) then
tmp = t_1
else if (t_2 <= 1d+295) then
tmp = a * 120.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (y / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+136) {
tmp = t_1;
} else if (t_2 <= 1e+295) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (y / t) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -1e+136: tmp = t_1 elif t_2 <= 1e+295: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(y / t)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+136) tmp = t_1; elseif (t_2 <= 1e+295) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * (y / t); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -1e+136) tmp = t_1; elseif (t_2 <= 1e+295) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+136], t$95$1, If[LessEqual[t$95$2, 1e+295], N[(a * 120.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{y}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+295}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000006e136 or 9.9999999999999998e294 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
Taylor expanded in y around inf
Applied rewrites38.2%
Applied rewrites38.2%
if -1.00000000000000006e136 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999998e294Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6457.1
Applied rewrites57.1%
Final simplification53.5%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -5e-92)
(* a 120.0)
(if (<= (* a 120.0) 2e-268)
(* (- x y) (/ -60.0 t))
(if (<= (* a 120.0) 400000000.0) (/ (* 60.0 (- x y)) z) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e-92) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 2e-268) {
tmp = (x - y) * (-60.0 / t);
} else if ((a * 120.0) <= 400000000.0) {
tmp = (60.0 * (x - y)) / z;
} else {
tmp = 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 ((a * 120.0d0) <= (-5d-92)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 2d-268) then
tmp = (x - y) * ((-60.0d0) / t)
else if ((a * 120.0d0) <= 400000000.0d0) then
tmp = (60.0d0 * (x - y)) / z
else
tmp = 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 ((a * 120.0) <= -5e-92) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 2e-268) {
tmp = (x - y) * (-60.0 / t);
} else if ((a * 120.0) <= 400000000.0) {
tmp = (60.0 * (x - y)) / z;
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -5e-92: tmp = a * 120.0 elif (a * 120.0) <= 2e-268: tmp = (x - y) * (-60.0 / t) elif (a * 120.0) <= 400000000.0: tmp = (60.0 * (x - y)) / z else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e-92) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 2e-268) tmp = Float64(Float64(x - y) * Float64(-60.0 / t)); elseif (Float64(a * 120.0) <= 400000000.0) tmp = Float64(Float64(60.0 * Float64(x - y)) / z); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -5e-92) tmp = a * 120.0; elseif ((a * 120.0) <= 2e-268) tmp = (x - y) * (-60.0 / t); elseif ((a * 120.0) <= 400000000.0) tmp = (60.0 * (x - y)) / z; else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e-92], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-268], N[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 400000000.0], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-92}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{-268}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\
\mathbf{elif}\;a \cdot 120 \leq 400000000:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000011e-92 or 4e8 < (*.f64 a #s(literal 120 binary64)) Initial program 98.5%
Taylor expanded in z around inf
lower-*.f6474.8
Applied rewrites74.8%
if -5.00000000000000011e-92 < (*.f64 a #s(literal 120 binary64)) < 1.99999999999999992e-268Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6465.1
Applied rewrites65.1%
Taylor expanded in t around 0
Applied rewrites54.3%
Applied rewrites54.3%
if 1.99999999999999992e-268 < (*.f64 a #s(literal 120 binary64)) < 4e8Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6464.4
Applied rewrites64.4%
Taylor expanded in z around 0
Applied rewrites53.2%
Final simplification64.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ (- x y) t) (* a 120.0))))
(if (<= t -4.6e-26)
t_1
(if (<= t -5e-113)
(/ (* 60.0 (- x y)) (- z t))
(if (<= t 1.05e-100)
(fma 60.0 (/ (- x y) z) (* a 120.0))
(if (<= t 7.5e+57) (fma a 120.0 (/ (* 60.0 x) (- z t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, ((x - y) / t), (a * 120.0));
double tmp;
if (t <= -4.6e-26) {
tmp = t_1;
} else if (t <= -5e-113) {
tmp = (60.0 * (x - y)) / (z - t);
} else if (t <= 1.05e-100) {
tmp = fma(60.0, ((x - y) / z), (a * 120.0));
} else if (t <= 7.5e+57) {
tmp = fma(a, 120.0, ((60.0 * x) / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0)) tmp = 0.0 if (t <= -4.6e-26) tmp = t_1; elseif (t <= -5e-113) tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)); elseif (t <= 1.05e-100) tmp = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0)); elseif (t <= 7.5e+57) tmp = fma(a, 120.0, Float64(Float64(60.0 * x) / Float64(z - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e-26], t$95$1, If[LessEqual[t, -5e-113], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e-100], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+57], N[(a * 120.0 + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-113}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-100}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+57}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.60000000000000018e-26 or 7.5000000000000006e57 < t Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6489.6
Applied rewrites89.6%
if -4.60000000000000018e-26 < t < -4.9999999999999997e-113Initial program 95.5%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6481.7
Applied rewrites81.7%
if -4.9999999999999997e-113 < t < 1.05000000000000005e-100Initial program 98.9%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6490.8
Applied rewrites90.8%
if 1.05000000000000005e-100 < t < 7.5000000000000006e57Initial program 99.9%
Taylor expanded in x around inf
lower-*.f6489.5
Applied rewrites89.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6489.5
Applied rewrites89.5%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -1e-57) (fma 60.0 (/ x z) (* a 120.0)) (if (<= (* a 120.0) 1e+35) (/ (* 60.0 (- x y)) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e-57) {
tmp = fma(60.0, (x / z), (a * 120.0));
} else if ((a * 120.0) <= 1e+35) {
tmp = (60.0 * (x - y)) / (z - t);
} else {
tmp = a * 120.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e-57) tmp = fma(60.0, Float64(x / z), Float64(a * 120.0)); elseif (Float64(a * 120.0) <= 1e+35) tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)); else tmp = Float64(a * 120.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-57], N[(60.0 * N[(x / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e+35], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, a \cdot 120\right)\\
\mathbf{elif}\;a \cdot 120 \leq 10^{+35}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999955e-58Initial program 98.6%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.9
Applied rewrites75.9%
Taylor expanded in x around inf
Applied rewrites72.3%
if -9.99999999999999955e-58 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999997e34Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6482.9
Applied rewrites82.9%
if 9.9999999999999997e34 < (*.f64 a #s(literal 120 binary64)) Initial program 97.9%
Taylor expanded in z around inf
lower-*.f6490.2
Applied rewrites90.2%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -1e-57) (fma x (/ 60.0 z) (* a 120.0)) (if (<= (* a 120.0) 1e+35) (/ (* 60.0 (- x y)) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e-57) {
tmp = fma(x, (60.0 / z), (a * 120.0));
} else if ((a * 120.0) <= 1e+35) {
tmp = (60.0 * (x - y)) / (z - t);
} else {
tmp = a * 120.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e-57) tmp = fma(x, Float64(60.0 / z), Float64(a * 120.0)); elseif (Float64(a * 120.0) <= 1e+35) tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)); else tmp = Float64(a * 120.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-57], N[(x * N[(60.0 / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e+35], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-57}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{60}{z}, a \cdot 120\right)\\
\mathbf{elif}\;a \cdot 120 \leq 10^{+35}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999955e-58Initial program 98.6%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.9
Applied rewrites75.9%
Taylor expanded in y around 0
Applied rewrites72.2%
if -9.99999999999999955e-58 < (*.f64 a #s(literal 120 binary64)) < 9.9999999999999997e34Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6482.9
Applied rewrites82.9%
if 9.9999999999999997e34 < (*.f64 a #s(literal 120 binary64)) Initial program 97.9%
Taylor expanded in z around inf
lower-*.f6490.2
Applied rewrites90.2%
Final simplification81.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ (- x y) t) (* a 120.0))))
(if (<= t -4.6e-26)
t_1
(if (<= t -5e-113)
(/ (* 60.0 (- x y)) (- z t))
(if (<= t 4.6e-19) (fma 60.0 (/ (- x y) z) (* a 120.0)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, ((x - y) / t), (a * 120.0));
double tmp;
if (t <= -4.6e-26) {
tmp = t_1;
} else if (t <= -5e-113) {
tmp = (60.0 * (x - y)) / (z - t);
} else if (t <= 4.6e-19) {
tmp = fma(60.0, ((x - y) / z), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(Float64(x - y) / t), Float64(a * 120.0)) tmp = 0.0 if (t <= -4.6e-26) tmp = t_1; elseif (t <= -5e-113) tmp = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)); elseif (t <= 4.6e-19) tmp = fma(60.0, Float64(Float64(x - y) / z), Float64(a * 120.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e-26], t$95$1, If[LessEqual[t, -5e-113], N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-19], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-113}:\\
\;\;\;\;\frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.60000000000000018e-26 or 4.5999999999999996e-19 < t Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6487.4
Applied rewrites87.4%
if -4.60000000000000018e-26 < t < -4.9999999999999997e-113Initial program 95.5%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6481.7
Applied rewrites81.7%
if -4.9999999999999997e-113 < t < 4.5999999999999996e-19Initial program 99.0%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6488.5
Applied rewrites88.5%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -5e-92) (* a 120.0) (if (<= (* a 120.0) 4e+14) (/ (* (- x y) -60.0) t) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e-92) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 4e+14) {
tmp = ((x - y) * -60.0) / t;
} else {
tmp = 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 ((a * 120.0d0) <= (-5d-92)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 4d+14) then
tmp = ((x - y) * (-60.0d0)) / t
else
tmp = 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 ((a * 120.0) <= -5e-92) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 4e+14) {
tmp = ((x - y) * -60.0) / t;
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -5e-92: tmp = a * 120.0 elif (a * 120.0) <= 4e+14: tmp = ((x - y) * -60.0) / t else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e-92) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 4e+14) tmp = Float64(Float64(Float64(x - y) * -60.0) / t); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -5e-92) tmp = a * 120.0; elseif ((a * 120.0) <= 4e+14) tmp = ((x - y) * -60.0) / t; else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e-92], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 4e+14], N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-92}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+14}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000011e-92 or 4e14 < (*.f64 a #s(literal 120 binary64)) Initial program 98.5%
Taylor expanded in z around inf
lower-*.f6475.4
Applied rewrites75.4%
if -5.00000000000000011e-92 < (*.f64 a #s(literal 120 binary64)) < 4e14Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
Taylor expanded in t around 0
Applied rewrites47.2%
Final simplification61.9%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -5e-92) (* a 120.0) (if (<= (* a 120.0) 4e+14) (* (- x y) (/ -60.0 t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e-92) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 4e+14) {
tmp = (x - y) * (-60.0 / t);
} else {
tmp = 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 ((a * 120.0d0) <= (-5d-92)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 4d+14) then
tmp = (x - y) * ((-60.0d0) / t)
else
tmp = 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 ((a * 120.0) <= -5e-92) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 4e+14) {
tmp = (x - y) * (-60.0 / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -5e-92: tmp = a * 120.0 elif (a * 120.0) <= 4e+14: tmp = (x - y) * (-60.0 / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e-92) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 4e+14) tmp = Float64(Float64(x - y) * Float64(-60.0 / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -5e-92) tmp = a * 120.0; elseif ((a * 120.0) <= 4e+14) tmp = (x - y) * (-60.0 / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -5e-92], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 4e+14], N[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-92}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{+14}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{-60}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -5.00000000000000011e-92 or 4e14 < (*.f64 a #s(literal 120 binary64)) Initial program 98.5%
Taylor expanded in z around inf
lower-*.f6475.4
Applied rewrites75.4%
if -5.00000000000000011e-92 < (*.f64 a #s(literal 120 binary64)) < 4e14Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
Taylor expanded in t around 0
Applied rewrites47.2%
Applied rewrites47.2%
Final simplification61.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ y t) (* a 120.0))))
(if (<= t -6.2e-78)
t_1
(if (<= t 3.5e+52) (fma x (/ 60.0 z) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(60.0, (y / t), (a * 120.0));
double tmp;
if (t <= -6.2e-78) {
tmp = t_1;
} else if (t <= 3.5e+52) {
tmp = fma(x, (60.0 / z), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(60.0, Float64(y / t), Float64(a * 120.0)) tmp = 0.0 if (t <= -6.2e-78) tmp = t_1; elseif (t <= 3.5e+52) tmp = fma(x, Float64(60.0 / z), Float64(a * 120.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(y / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e-78], t$95$1, If[LessEqual[t, 3.5e+52], N[(x * N[(60.0 / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(60, \frac{y}{t}, a \cdot 120\right)\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(x, \frac{60}{z}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.20000000000000035e-78 or 3.5e52 < t Initial program 99.0%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6484.8
Applied rewrites84.8%
Taylor expanded in x around 0
Applied rewrites70.7%
if -6.20000000000000035e-78 < t < 3.5e52Initial program 99.1%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6482.6
Applied rewrites82.6%
Taylor expanded in y around 0
Applied rewrites59.9%
Final simplification65.1%
(FPCore (x y z t a) :precision binary64 (fma (/ 60.0 (- z t)) (- x y) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return fma((60.0 / (z - t)), (x - y), (a * 120.0));
}
function code(x, y, z, t, a) return fma(Float64(60.0 / Float64(z - t)), Float64(x - y), Float64(a * 120.0)) end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{60}{z - t}, x - y, a \cdot 120\right)
\end{array}
Initial program 99.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ (* (- x y) -60.0) (- t z))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, (((x - y) * -60.0) / (t - z)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(Float64(x - y) * -60.0) / Float64(t - z))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{\left(x - y\right) \cdot -60}{t - z}\right)
\end{array}
Initial program 99.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.1
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.1
Applied rewrites99.1%
(FPCore (x y z t a) :precision binary64 (* a 120.0))
double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = a * 120.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
def code(x, y, z, t, a): return a * 120.0
function code(x, y, z, t, a) return Float64(a * 120.0) end
function tmp = code(x, y, z, t, a) tmp = a * 120.0; end
code[x_, y_, z_, t_, a_] := N[(a * 120.0), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120
\end{array}
Initial program 99.1%
Taylor expanded in z around inf
lower-*.f6447.9
Applied rewrites47.9%
Final simplification47.9%
(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 2024219
(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)))