
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ (* (- x y) -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.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
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.8
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- x y) 60.0)) (t_2 (/ t_1 (- z t))))
(if (<= t_2 -0.02)
(/ t_1 (- t))
(if (<= t_2 2e+99) (* a 120.0) (/ (- x y) (* t -0.016666666666666666))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - y) * 60.0;
double t_2 = t_1 / (z - t);
double tmp;
if (t_2 <= -0.02) {
tmp = t_1 / -t;
} else if (t_2 <= 2e+99) {
tmp = a * 120.0;
} else {
tmp = (x - y) / (t * -0.016666666666666666);
}
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 = (x - y) * 60.0d0
t_2 = t_1 / (z - t)
if (t_2 <= (-0.02d0)) then
tmp = t_1 / -t
else if (t_2 <= 2d+99) then
tmp = a * 120.0d0
else
tmp = (x - y) / (t * (-0.016666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x - y) * 60.0;
double t_2 = t_1 / (z - t);
double tmp;
if (t_2 <= -0.02) {
tmp = t_1 / -t;
} else if (t_2 <= 2e+99) {
tmp = a * 120.0;
} else {
tmp = (x - y) / (t * -0.016666666666666666);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - y) * 60.0 t_2 = t_1 / (z - t) tmp = 0 if t_2 <= -0.02: tmp = t_1 / -t elif t_2 <= 2e+99: tmp = a * 120.0 else: tmp = (x - y) / (t * -0.016666666666666666) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - y) * 60.0) t_2 = Float64(t_1 / Float64(z - t)) tmp = 0.0 if (t_2 <= -0.02) tmp = Float64(t_1 / Float64(-t)); elseif (t_2 <= 2e+99) tmp = Float64(a * 120.0); else tmp = Float64(Float64(x - y) / Float64(t * -0.016666666666666666)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - y) * 60.0; t_2 = t_1 / (z - t); tmp = 0.0; if (t_2 <= -0.02) tmp = t_1 / -t; elseif (t_2 <= 2e+99) tmp = a * 120.0; else tmp = (x - y) / (t * -0.016666666666666666); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -0.02], N[(t$95$1 / (-t)), $MachinePrecision], If[LessEqual[t$95$2, 2e+99], N[(a * 120.0), $MachinePrecision], N[(N[(x - y), $MachinePrecision] / N[(t * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot 60\\
t_2 := \frac{t\_1}{z - t}\\
\mathbf{if}\;t\_2 \leq -0.02:\\
\;\;\;\;\frac{t\_1}{-t}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+99}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{t \cdot -0.016666666666666666}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -0.0200000000000000004Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6483.2
Applied rewrites83.2%
Taylor expanded in z around 0
Applied rewrites53.7%
if -0.0200000000000000004 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e99Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6470.4
Applied rewrites70.4%
if 1.9999999999999999e99 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6482.5
Applied rewrites82.5%
Applied rewrites82.6%
Taylor expanded in z around 0
Applied rewrites57.5%
Final simplification64.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x y) (* t -0.016666666666666666)))
(t_2 (/ (* (- x y) 60.0) (- z t))))
(if (<= t_2 -0.02) t_1 (if (<= t_2 2e+99) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - y) / (t * -0.016666666666666666);
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -0.02) {
tmp = t_1;
} else if (t_2 <= 2e+99) {
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 = (x - y) / (t * (-0.016666666666666666d0))
t_2 = ((x - y) * 60.0d0) / (z - t)
if (t_2 <= (-0.02d0)) then
tmp = t_1
else if (t_2 <= 2d+99) 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 = (x - y) / (t * -0.016666666666666666);
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -0.02) {
tmp = t_1;
} else if (t_2 <= 2e+99) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - y) / (t * -0.016666666666666666) t_2 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_2 <= -0.02: tmp = t_1 elif t_2 <= 2e+99: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - y) / Float64(t * -0.016666666666666666)) t_2 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_2 <= -0.02) tmp = t_1; elseif (t_2 <= 2e+99) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - y) / (t * -0.016666666666666666); t_2 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_2 <= -0.02) tmp = t_1; elseif (t_2 <= 2e+99) 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[(x - y), $MachinePrecision] / N[(t * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -0.02], t$95$1, If[LessEqual[t$95$2, 2e+99], N[(a * 120.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{t \cdot -0.016666666666666666}\\
t_2 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_2 \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+99}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -0.0200000000000000004 or 1.9999999999999999e99 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6483.0
Applied rewrites83.0%
Applied rewrites82.9%
Taylor expanded in z around 0
Applied rewrites55.1%
if -0.0200000000000000004 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e99Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6470.4
Applied rewrites70.4%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ (- x y) t))) (t_2 (/ (* (- x y) 60.0) (- z t)))) (if (<= t_2 -0.02) t_1 (if (<= t_2 2e+99) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * ((x - y) / t);
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -0.02) {
tmp = t_1;
} else if (t_2 <= 2e+99) {
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) * ((x - y) / t)
t_2 = ((x - y) * 60.0d0) / (z - t)
if (t_2 <= (-0.02d0)) then
tmp = t_1
else if (t_2 <= 2d+99) 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 * ((x - y) / t);
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -0.02) {
tmp = t_1;
} else if (t_2 <= 2e+99) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * ((x - y) / t) t_2 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_2 <= -0.02: tmp = t_1 elif t_2 <= 2e+99: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(Float64(x - y) / t)) t_2 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_2 <= -0.02) tmp = t_1; elseif (t_2 <= 2e+99) 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 * ((x - y) / t); t_2 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_2 <= -0.02) tmp = t_1; elseif (t_2 <= 2e+99) 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[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -0.02], t$95$1, If[LessEqual[t$95$2, 2e+99], N[(a * 120.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{x - y}{t}\\
t_2 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_2 \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+99}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -0.0200000000000000004 or 1.9999999999999999e99 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6483.0
Applied rewrites83.0%
Taylor expanded in z around 0
Applied rewrites55.0%
if -0.0200000000000000004 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.9999999999999999e99Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6470.4
Applied rewrites70.4%
Final simplification64.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (<= t_1 -2e+46)
(/ (* y 60.0) t)
(if (<= t_1 2e+85) (* a 120.0) (/ (* x 60.0) (- t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+46) {
tmp = (y * 60.0) / t;
} else if (t_1 <= 2e+85) {
tmp = a * 120.0;
} else {
tmp = (x * 60.0) / -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((x - y) * 60.0d0) / (z - t)
if (t_1 <= (-2d+46)) then
tmp = (y * 60.0d0) / t
else if (t_1 <= 2d+85) then
tmp = a * 120.0d0
else
tmp = (x * 60.0d0) / -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+46) {
tmp = (y * 60.0) / t;
} else if (t_1 <= 2e+85) {
tmp = a * 120.0;
} else {
tmp = (x * 60.0) / -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_1 <= -2e+46: tmp = (y * 60.0) / t elif t_1 <= 2e+85: tmp = a * 120.0 else: tmp = (x * 60.0) / -t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+46) tmp = Float64(Float64(y * 60.0) / t); elseif (t_1 <= 2e+85) tmp = Float64(a * 120.0); else tmp = Float64(Float64(x * 60.0) / Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_1 <= -2e+46) tmp = (y * 60.0) / t; elseif (t_1 <= 2e+85) tmp = a * 120.0; else tmp = (x * 60.0) / -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+46], N[(N[(y * 60.0), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 2e+85], N[(a * 120.0), $MachinePrecision], N[(N[(x * 60.0), $MachinePrecision] / (-t)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+46}:\\
\;\;\;\;\frac{y \cdot 60}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+85}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 60}{-t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e46Initial program 99.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6446.8
Applied rewrites46.8%
Taylor expanded in z around 0
Applied rewrites33.0%
if -2e46 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e85Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6469.3
Applied rewrites69.3%
if 2e85 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6482.5
Applied rewrites82.5%
Taylor expanded in z around 0
Applied rewrites54.6%
Taylor expanded in x around inf
Applied rewrites37.2%
Final simplification56.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (<= t_1 -2e+46)
(/ (* y 60.0) t)
(if (<= t_1 1e+163) (* a 120.0) (* y (/ 60.0 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+46) {
tmp = (y * 60.0) / t;
} else if (t_1 <= 1e+163) {
tmp = a * 120.0;
} else {
tmp = y * (60.0 / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((x - y) * 60.0d0) / (z - t)
if (t_1 <= (-2d+46)) then
tmp = (y * 60.0d0) / t
else if (t_1 <= 1d+163) then
tmp = a * 120.0d0
else
tmp = y * (60.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+46) {
tmp = (y * 60.0) / t;
} else if (t_1 <= 1e+163) {
tmp = a * 120.0;
} else {
tmp = y * (60.0 / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_1 <= -2e+46: tmp = (y * 60.0) / t elif t_1 <= 1e+163: tmp = a * 120.0 else: tmp = y * (60.0 / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+46) tmp = Float64(Float64(y * 60.0) / t); elseif (t_1 <= 1e+163) tmp = Float64(a * 120.0); else tmp = Float64(y * Float64(60.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_1 <= -2e+46) tmp = (y * 60.0) / t; elseif (t_1 <= 1e+163) tmp = a * 120.0; else tmp = y * (60.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+46], N[(N[(y * 60.0), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 1e+163], N[(a * 120.0), $MachinePrecision], N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+46}:\\
\;\;\;\;\frac{y \cdot 60}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{+163}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{60}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e46Initial program 99.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6446.8
Applied rewrites46.8%
Taylor expanded in z around 0
Applied rewrites33.0%
if -2e46 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999994e162Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6465.5
Applied rewrites65.5%
if 9.9999999999999994e162 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6445.6
Applied rewrites45.6%
Taylor expanded in x around inf
Applied rewrites28.2%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/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--.f6450.5
Applied rewrites50.5%
Taylor expanded in z around 0
Applied rewrites33.2%
Final simplification55.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y 60.0) t)) (t_2 (/ (* (- x y) 60.0) (- z t)))) (if (<= t_2 -2e+46) t_1 (if (<= t_2 1e+163) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * 60.0) / t;
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -2e+46) {
tmp = t_1;
} else if (t_2 <= 1e+163) {
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 = (y * 60.0d0) / t
t_2 = ((x - y) * 60.0d0) / (z - t)
if (t_2 <= (-2d+46)) then
tmp = t_1
else if (t_2 <= 1d+163) 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 = (y * 60.0) / t;
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -2e+46) {
tmp = t_1;
} else if (t_2 <= 1e+163) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * 60.0) / t t_2 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_2 <= -2e+46: tmp = t_1 elif t_2 <= 1e+163: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * 60.0) / t) t_2 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_2 <= -2e+46) tmp = t_1; elseif (t_2 <= 1e+163) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * 60.0) / t; t_2 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_2 <= -2e+46) tmp = t_1; elseif (t_2 <= 1e+163) 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[(y * 60.0), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+46], t$95$1, If[LessEqual[t$95$2, 1e+163], N[(a * 120.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot 60}{t}\\
t_2 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+163}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e46 or 9.9999999999999994e162 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6447.8
Applied rewrites47.8%
Taylor expanded in z around 0
Applied rewrites33.0%
if -2e46 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999994e162Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6465.5
Applied rewrites65.5%
Final simplification55.8%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -5e+97) (* a 120.0) (if (<= (* a 120.0) 1e-33) (/ (* (- x y) 60.0) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e+97) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-33) {
tmp = ((x - y) * 60.0) / (z - 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+97)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 1d-33) then
tmp = ((x - y) * 60.0d0) / (z - 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+97) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-33) {
tmp = ((x - y) * 60.0) / (z - t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -5e+97: tmp = a * 120.0 elif (a * 120.0) <= 1e-33: tmp = ((x - y) * 60.0) / (z - t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e+97) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 1e-33) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - 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+97) tmp = a * 120.0; elseif ((a * 120.0) <= 1e-33) tmp = ((x - y) * 60.0) / (z - 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+97], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-33], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+97}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-33}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -4.99999999999999999e97 or 1.0000000000000001e-33 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6479.7
Applied rewrites79.7%
if -4.99999999999999999e97 < (*.f64 a #s(literal 120 binary64)) < 1.0000000000000001e-33Initial program 99.7%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6478.7
Applied rewrites78.7%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -5e+97) (* a 120.0) (if (<= (* a 120.0) 1e-33) (* (- x y) (/ 60.0 (- z t))) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -5e+97) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-33) {
tmp = (x - y) * (60.0 / (z - 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+97)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 1d-33) then
tmp = (x - y) * (60.0d0 / (z - 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+97) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-33) {
tmp = (x - y) * (60.0 / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -5e+97: tmp = a * 120.0 elif (a * 120.0) <= 1e-33: tmp = (x - y) * (60.0 / (z - t)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -5e+97) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 1e-33) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - 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+97) tmp = a * 120.0; elseif ((a * 120.0) <= 1e-33) tmp = (x - y) * (60.0 / (z - 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+97], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-33], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{+97}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-33}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -4.99999999999999999e97 or 1.0000000000000001e-33 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6479.7
Applied rewrites79.7%
if -4.99999999999999999e97 < (*.f64 a #s(literal 120 binary64)) < 1.0000000000000001e-33Initial program 99.7%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6478.7
Applied rewrites78.7%
Applied rewrites78.6%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ y z) (* a 120.0))))
(if (<= z -3.1e+67)
t_1
(if (<= z -2.75e-44)
(/ (* (- x y) 60.0) (- z t))
(if (<= z 2.45e+67) (fma -60.0 (/ (- x y) t) (* a 120.0)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, (y / z), (a * 120.0));
double tmp;
if (z <= -3.1e+67) {
tmp = t_1;
} else if (z <= -2.75e-44) {
tmp = ((x - y) * 60.0) / (z - t);
} else if (z <= 2.45e+67) {
tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(y / z), Float64(a * 120.0)) tmp = 0.0 if (z <= -3.1e+67) tmp = t_1; elseif (z <= -2.75e-44) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)); elseif (z <= 2.45e+67) tmp = fma(-60.0, Float64(Float64(x - y) / t), 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 / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+67], t$95$1, If[LessEqual[z, -2.75e-44], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e+67], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-44}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.09999999999999996e67 or 2.44999999999999995e67 < z Initial program 99.9%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6487.1
Applied rewrites87.1%
Taylor expanded in x around 0
Applied rewrites80.1%
if -3.09999999999999996e67 < z < -2.74999999999999996e-44Initial program 99.7%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6476.3
Applied rewrites76.3%
if -2.74999999999999996e-44 < z < 2.44999999999999995e67Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6486.4
Applied rewrites86.4%
Final simplification83.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.05e-181)
(fma -60.0 (/ y z) (* a 120.0))
(if (<= z -2.95e-240)
(* a 120.0)
(if (<= z 4.4e-133)
(/ (* (- x y) 60.0) (- t))
(fma a 120.0 (/ x (* z 0.016666666666666666)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.05e-181) {
tmp = fma(-60.0, (y / z), (a * 120.0));
} else if (z <= -2.95e-240) {
tmp = a * 120.0;
} else if (z <= 4.4e-133) {
tmp = ((x - y) * 60.0) / -t;
} else {
tmp = fma(a, 120.0, (x / (z * 0.016666666666666666)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.05e-181) tmp = fma(-60.0, Float64(y / z), Float64(a * 120.0)); elseif (z <= -2.95e-240) tmp = Float64(a * 120.0); elseif (z <= 4.4e-133) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(-t)); else tmp = fma(a, 120.0, Float64(x / Float64(z * 0.016666666666666666))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.05e-181], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.95e-240], N[(a * 120.0), $MachinePrecision], If[LessEqual[z, 4.4e-133], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / (-t)), $MachinePrecision], N[(a * 120.0 + N[(x / N[(z * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.05 \cdot 10^{-181}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\mathbf{elif}\;z \leq -2.95 \cdot 10^{-240}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-133}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{-t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z \cdot 0.016666666666666666}\right)\\
\end{array}
\end{array}
if z < -3.05e-181Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6473.5
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites64.4%
if -3.05e-181 < z < -2.9499999999999998e-240Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6479.6
Applied rewrites79.6%
if -2.9499999999999998e-240 < z < 4.4000000000000001e-133Initial program 99.9%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6473.6
Applied rewrites73.6%
Taylor expanded in z around 0
Applied rewrites68.4%
if 4.4000000000000001e-133 < z Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6476.9
Applied rewrites76.9%
Taylor expanded in y around 0
Applied rewrites67.8%
Applied rewrites67.8%
Final simplification67.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ y z) (* a 120.0))))
(if (<= z -3.05e-181)
t_1
(if (<= z -2.95e-240)
(* a 120.0)
(if (<= z 4.4e-133) (/ (* (- x y) 60.0) (- t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, (y / z), (a * 120.0));
double tmp;
if (z <= -3.05e-181) {
tmp = t_1;
} else if (z <= -2.95e-240) {
tmp = a * 120.0;
} else if (z <= 4.4e-133) {
tmp = ((x - y) * 60.0) / -t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(y / z), Float64(a * 120.0)) tmp = 0.0 if (z <= -3.05e-181) tmp = t_1; elseif (z <= -2.95e-240) tmp = Float64(a * 120.0); elseif (z <= 4.4e-133) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(-t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.05e-181], t$95$1, If[LessEqual[z, -2.95e-240], N[(a * 120.0), $MachinePrecision], If[LessEqual[z, 4.4e-133], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / (-t)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.95 \cdot 10^{-240}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-133}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{-t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.05e-181 or 4.4000000000000001e-133 < z Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.2
Applied rewrites75.2%
Taylor expanded in x around 0
Applied rewrites65.7%
if -3.05e-181 < z < -2.9499999999999998e-240Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6479.6
Applied rewrites79.6%
if -2.9499999999999998e-240 < z < 4.4000000000000001e-133Initial program 99.9%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6473.6
Applied rewrites73.6%
Taylor expanded in z around 0
Applied rewrites68.4%
Final simplification66.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* y 60.0) (- t z)))))
(if (<= y -340.0)
t_1
(if (<= y 6.5e+80) (fma a 120.0 (/ (* x -60.0) (- t z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, ((y * 60.0) / (t - z)));
double tmp;
if (y <= -340.0) {
tmp = t_1;
} else if (y <= 6.5e+80) {
tmp = fma(a, 120.0, ((x * -60.0) / (t - z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(y * 60.0) / Float64(t - z))) tmp = 0.0 if (y <= -340.0) tmp = t_1; elseif (y <= 6.5e+80) tmp = fma(a, 120.0, Float64(Float64(x * -60.0) / Float64(t - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(N[(y * 60.0), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -340.0], t$95$1, If[LessEqual[y, 6.5e+80], N[(a * 120.0 + N[(N[(x * -60.0), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{y \cdot 60}{t - z}\right)\\
\mathbf{if}\;y \leq -340:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x \cdot -60}{t - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -340 or 6.4999999999999998e80 < y Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
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.8
Applied rewrites99.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f6487.5
Applied rewrites87.5%
if -340 < y < 6.4999999999999998e80Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
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.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-*.f6493.2
Applied rewrites93.2%
Final simplification90.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ (- x y) z) (* a 120.0))))
(if (<= z -2.1e-53)
t_1
(if (<= z 1.45e-67) (fma -60.0 (/ (- x y) t) (* 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) / z), (a * 120.0));
double tmp;
if (z <= -2.1e-53) {
tmp = t_1;
} else if (z <= 1.45e-67) {
tmp = fma(-60.0, ((x - y) / t), (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) / z), Float64(a * 120.0)) tmp = 0.0 if (z <= -2.1e-53) tmp = t_1; elseif (z <= 1.45e-67) tmp = fma(-60.0, Float64(Float64(x - y) / t), 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] / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-53], t$95$1, If[LessEqual[z, 1.45e-67], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $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}{z}, a \cdot 120\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.09999999999999977e-53 or 1.45000000000000002e-67 < z Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6480.8
Applied rewrites80.8%
if -2.09999999999999977e-53 < z < 1.45000000000000002e-67Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6493.5
Applied rewrites93.5%
Final simplification86.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ x (- z t)) (* a 120.0))))
(if (<= z -2.6e-16)
t_1
(if (<= z 1.95e-81) (fma -60.0 (/ (- x y) t) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(60.0, (x / (z - t)), (a * 120.0));
double tmp;
if (z <= -2.6e-16) {
tmp = t_1;
} else if (z <= 1.95e-81) {
tmp = fma(-60.0, ((x - y) / t), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(60.0, Float64(x / Float64(z - t)), Float64(a * 120.0)) tmp = 0.0 if (z <= -2.6e-16) tmp = t_1; elseif (z <= 1.95e-81) tmp = fma(-60.0, Float64(Float64(x - y) / t), 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[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e-16], t$95$1, If[LessEqual[z, 1.95e-81], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(60, \frac{x}{z - t}, a \cdot 120\right)\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-81}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.5999999999999998e-16 or 1.94999999999999992e-81 < z Initial program 99.8%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6480.3
Applied rewrites80.3%
if -2.5999999999999998e-16 < z < 1.94999999999999992e-81Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6490.7
Applied rewrites90.7%
Final simplification84.9%
(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.8%
Taylor expanded in z around inf
lower-*.f6449.6
Applied rewrites49.6%
Final simplification49.6%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
herbie shell --seed 2024232
(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)))