
(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) (* (- z t) 0.016666666666666666))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) / ((z - t) * 0.016666666666666666)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) / Float64(Float64(z - t) * 0.016666666666666666))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{x - y}{\left(z - t\right) \cdot 0.016666666666666666}\right)
\end{array}
Initial program 99.7%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.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%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (- x y) 60.0)) (t_2 (/ t_1 z)) (t_3 (/ t_1 (- z t)))) (if (<= t_3 -1e+138) t_2 (if (<= t_3 1e+25) (* a 120.0) t_2))))
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;
double t_3 = t_1 / (z - t);
double tmp;
if (t_3 <= -1e+138) {
tmp = t_2;
} else if (t_3 <= 1e+25) {
tmp = a * 120.0;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = (x - y) * 60.0d0
t_2 = t_1 / z
t_3 = t_1 / (z - t)
if (t_3 <= (-1d+138)) then
tmp = t_2
else if (t_3 <= 1d+25) then
tmp = a * 120.0d0
else
tmp = t_2
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;
double t_3 = t_1 / (z - t);
double tmp;
if (t_3 <= -1e+138) {
tmp = t_2;
} else if (t_3 <= 1e+25) {
tmp = a * 120.0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - y) * 60.0 t_2 = t_1 / z t_3 = t_1 / (z - t) tmp = 0 if t_3 <= -1e+138: tmp = t_2 elif t_3 <= 1e+25: tmp = a * 120.0 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - y) * 60.0) t_2 = Float64(t_1 / z) t_3 = Float64(t_1 / Float64(z - t)) tmp = 0.0 if (t_3 <= -1e+138) tmp = t_2; elseif (t_3 <= 1e+25) tmp = Float64(a * 120.0); else tmp = t_2; 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_3 = t_1 / (z - t); tmp = 0.0; if (t_3 <= -1e+138) tmp = t_2; elseif (t_3 <= 1e+25) tmp = a * 120.0; else tmp = t_2; 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 / z), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+138], t$95$2, If[LessEqual[t$95$3, 1e+25], N[(a * 120.0), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot 60\\
t_2 := \frac{t\_1}{z}\\
t_3 := \frac{t\_1}{z - t}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 10^{+25}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1e138 or 1.00000000000000009e25 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
Taylor expanded in z around 0
Applied rewrites56.8%
if -1e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000009e25Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6469.9
Applied rewrites69.9%
Final simplification65.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (<= t_1 -1e+138)
(* x (/ -60.0 t))
(if (<= t_1 2e+92) (* a 120.0) (/ (* y -60.0) z)))))
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 <= -1e+138) {
tmp = x * (-60.0 / t);
} else if (t_1 <= 2e+92) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / z;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((x - y) * 60.0d0) / (z - t)
if (t_1 <= (-1d+138)) then
tmp = x * ((-60.0d0) / t)
else if (t_1 <= 2d+92) then
tmp = a * 120.0d0
else
tmp = (y * (-60.0d0)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -1e+138) {
tmp = x * (-60.0 / t);
} else if (t_1 <= 2e+92) {
tmp = a * 120.0;
} else {
tmp = (y * -60.0) / z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_1 <= -1e+138: tmp = x * (-60.0 / t) elif t_1 <= 2e+92: tmp = a * 120.0 else: tmp = (y * -60.0) / z 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 <= -1e+138) tmp = Float64(x * Float64(-60.0 / t)); elseif (t_1 <= 2e+92) tmp = Float64(a * 120.0); else tmp = Float64(Float64(y * -60.0) / z); 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 <= -1e+138) tmp = x * (-60.0 / t); elseif (t_1 <= 2e+92) tmp = a * 120.0; else tmp = (y * -60.0) / z; 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, -1e+138], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+92], N[(a * 120.0), $MachinePrecision], N[(N[(y * -60.0), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+92}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1e138Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6458.8
Applied rewrites58.8%
Taylor expanded in x around inf
Applied rewrites42.2%
Applied rewrites42.3%
if -1e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e92Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6465.5
Applied rewrites65.5%
if 2.0000000000000001e92 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6467.3
Applied rewrites67.3%
Taylor expanded in y around inf
Applied rewrites37.4%
Final simplification58.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (<= t_1 -1e+138)
(* x (/ -60.0 t))
(if (<= t_1 1e+172) (* a 120.0) (/ x (* t -0.016666666666666666))))))
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 <= -1e+138) {
tmp = x * (-60.0 / t);
} else if (t_1 <= 1e+172) {
tmp = a * 120.0;
} else {
tmp = x / (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) :: tmp
t_1 = ((x - y) * 60.0d0) / (z - t)
if (t_1 <= (-1d+138)) then
tmp = x * ((-60.0d0) / t)
else if (t_1 <= 1d+172) then
tmp = a * 120.0d0
else
tmp = x / (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) / (z - t);
double tmp;
if (t_1 <= -1e+138) {
tmp = x * (-60.0 / t);
} else if (t_1 <= 1e+172) {
tmp = a * 120.0;
} else {
tmp = x / (t * -0.016666666666666666);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_1 <= -1e+138: tmp = x * (-60.0 / t) elif t_1 <= 1e+172: tmp = a * 120.0 else: tmp = x / (t * -0.016666666666666666) 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 <= -1e+138) tmp = Float64(x * Float64(-60.0 / t)); elseif (t_1 <= 1e+172) tmp = Float64(a * 120.0); else tmp = Float64(x / Float64(t * -0.016666666666666666)); 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 <= -1e+138) tmp = x * (-60.0 / t); elseif (t_1 <= 1e+172) tmp = a * 120.0; else tmp = x / (t * -0.016666666666666666); 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, -1e+138], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+172], N[(a * 120.0), $MachinePrecision], N[(x / N[(t * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{+172}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot -0.016666666666666666}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1e138Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6458.8
Applied rewrites58.8%
Taylor expanded in x around inf
Applied rewrites42.2%
Applied rewrites42.3%
if -1e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.0000000000000001e172Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6462.3
Applied rewrites62.3%
if 1.0000000000000001e172 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6453.0
Applied rewrites53.0%
Taylor expanded in x around inf
Applied rewrites39.4%
Applied rewrites39.4%
Applied rewrites39.4%
Final simplification57.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* x (/ -60.0 t))) (t_2 (/ (* (- x y) 60.0) (- z t)))) (if (<= t_2 -1e+138) t_1 (if (<= t_2 1e+172) (* a 120.0) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (-60.0 / t);
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -1e+138) {
tmp = t_1;
} else if (t_2 <= 1e+172) {
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 * ((-60.0d0) / t)
t_2 = ((x - y) * 60.0d0) / (z - t)
if (t_2 <= (-1d+138)) then
tmp = t_1
else if (t_2 <= 1d+172) 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 * (-60.0 / t);
double t_2 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_2 <= -1e+138) {
tmp = t_1;
} else if (t_2 <= 1e+172) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (-60.0 / t) t_2 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_2 <= -1e+138: tmp = t_1 elif t_2 <= 1e+172: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(-60.0 / t)) t_2 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+138) tmp = t_1; elseif (t_2 <= 1e+172) 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 * (-60.0 / t); t_2 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_2 <= -1e+138) tmp = t_1; elseif (t_2 <= 1e+172) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(-60.0 / 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, -1e+138], t$95$1, If[LessEqual[t$95$2, 1e+172], N[(a * 120.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{-60}{t}\\
t_2 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+172}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1e138 or 1.0000000000000001e172 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6456.0
Applied rewrites56.0%
Taylor expanded in x around inf
Applied rewrites40.9%
Applied rewrites40.9%
if -1e138 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.0000000000000001e172Initial program 99.7%
Taylor expanded in z around inf
lower-*.f6462.3
Applied rewrites62.3%
Final simplification57.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma x (/ -60.0 (- t z)) (* a 120.0))))
(if (<= (* a 120.0) -1e-82)
t_1
(if (<= (* a 120.0) 0.3) (/ (* (- x y) 60.0) (- z t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(x, (-60.0 / (t - z)), (a * 120.0));
double tmp;
if ((a * 120.0) <= -1e-82) {
tmp = t_1;
} else if ((a * 120.0) <= 0.3) {
tmp = ((x - y) * 60.0) / (z - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(x, Float64(-60.0 / Float64(t - z)), Float64(a * 120.0)) tmp = 0.0 if (Float64(a * 120.0) <= -1e-82) tmp = t_1; elseif (Float64(a * 120.0) <= 0.3) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(-60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-82], t$95$1, If[LessEqual[N[(a * 120.0), $MachinePrecision], 0.3], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \frac{-60}{t - z}, a \cdot 120\right)\\
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot 120 \leq 0.3:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1e-82 or 0.299999999999999989 < (*.f64 a #s(literal 120 binary64)) Initial program 99.8%
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 y around 0
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-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6487.9
Applied rewrites87.9%
if -1e-82 < (*.f64 a #s(literal 120 binary64)) < 0.299999999999999989Initial program 99.6%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6486.4
Applied rewrites86.4%
Final simplification87.3%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -1e-57)
(* a 120.0)
(if (<= (* a 120.0) 20000000000.0)
(/ (* (- x y) 60.0) (- z t))
(fma -60.0 (/ y z) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e-57) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 20000000000.0) {
tmp = ((x - y) * 60.0) / (z - t);
} else {
tmp = fma(-60.0, (y / z), (a * 120.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e-57) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 20000000000.0) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)); else tmp = fma(-60.0, Float64(y / z), Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-57], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 20000000000.0], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-57}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 20000000000:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999955e-58Initial program 99.9%
Taylor expanded in z around inf
lower-*.f6475.1
Applied rewrites75.1%
if -9.99999999999999955e-58 < (*.f64 a #s(literal 120 binary64)) < 2e10Initial program 99.6%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6484.4
Applied rewrites84.4%
if 2e10 < (*.f64 a #s(literal 120 binary64)) Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6476.0
Applied rewrites76.0%
Taylor expanded in x around 0
Applied rewrites76.5%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= (* a 120.0) -1e-82) (* a 120.0) (if (<= (* a 120.0) 0.3) (/ (* y 60.0) (- t z)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e-82) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 0.3) {
tmp = (y * 60.0) / (t - 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) <= (-1d-82)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 0.3d0) then
tmp = (y * 60.0d0) / (t - 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) <= -1e-82) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 0.3) {
tmp = (y * 60.0) / (t - z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -1e-82: tmp = a * 120.0 elif (a * 120.0) <= 0.3: tmp = (y * 60.0) / (t - z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e-82) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 0.3) tmp = Float64(Float64(y * 60.0) / Float64(t - 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) <= -1e-82) tmp = a * 120.0; elseif ((a * 120.0) <= 0.3) tmp = (y * 60.0) / (t - z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-82], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 0.3], N[(N[(y * 60.0), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-82}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 0.3:\\
\;\;\;\;\frac{y \cdot 60}{t - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1e-82 or 0.299999999999999989 < (*.f64 a #s(literal 120 binary64)) Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6470.3
Applied rewrites70.3%
if -1e-82 < (*.f64 a #s(literal 120 binary64)) < 0.299999999999999989Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.6
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.6
Applied rewrites99.6%
Taylor expanded in y around 0
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-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6450.5
Applied rewrites50.5%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6451.4
Applied rewrites51.4%
Final simplification63.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* (- x y) -60.0) t))))
(if (<= t -1.5e-87)
t_1
(if (<= t 9e+35) (fma (/ 60.0 z) (- x y) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, (((x - y) * -60.0) / t));
double tmp;
if (t <= -1.5e-87) {
tmp = t_1;
} else if (t <= 9e+35) {
tmp = fma((60.0 / z), (x - y), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(Float64(x - y) * -60.0) / t)) tmp = 0.0 if (t <= -1.5e-87) tmp = t_1; elseif (t <= 9e+35) tmp = fma(Float64(60.0 / z), Float64(x - y), Float64(a * 120.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e-87], t$95$1, If[LessEqual[t, 9e+35], N[(N[(60.0 / z), $MachinePrecision] * N[(x - y), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{\left(x - y\right) \cdot -60}{t}\right)\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{60}{z}, x - y, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.50000000000000008e-87 or 8.9999999999999993e35 < t Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
Applied rewrites89.6%
if -1.50000000000000008e-87 < t < 8.9999999999999993e35Initial program 99.8%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6487.2
Applied rewrites87.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* (- x y) -60.0) t))))
(if (<= t -1.5e-87)
t_1
(if (<= t 9e+35)
(fma a 120.0 (/ (- x y) (* z 0.016666666666666666)))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, (((x - y) * -60.0) / t));
double tmp;
if (t <= -1.5e-87) {
tmp = t_1;
} else if (t <= 9e+35) {
tmp = fma(a, 120.0, ((x - y) / (z * 0.016666666666666666)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(Float64(x - y) * -60.0) / t)) tmp = 0.0 if (t <= -1.5e-87) tmp = t_1; elseif (t <= 9e+35) tmp = fma(a, 120.0, Float64(Float64(x - y) / Float64(z * 0.016666666666666666))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e-87], t$95$1, If[LessEqual[t, 9e+35], N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(z * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{\left(x - y\right) \cdot -60}{t}\right)\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{z \cdot 0.016666666666666666}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.50000000000000008e-87 or 8.9999999999999993e35 < t Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
Applied rewrites89.6%
if -1.50000000000000008e-87 < t < 8.9999999999999993e35Initial program 99.8%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.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 inf
*-commutativeN/A
lower-*.f6487.2
Applied rewrites87.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* (- x y) -60.0) t))))
(if (<= t -1.5e-87)
t_1
(if (<= t 9e+35) (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(a, 120.0, (((x - y) * -60.0) / t));
double tmp;
if (t <= -1.5e-87) {
tmp = t_1;
} else if (t <= 9e+35) {
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(a, 120.0, Float64(Float64(Float64(x - y) * -60.0) / t)) tmp = 0.0 if (t <= -1.5e-87) tmp = t_1; elseif (t <= 9e+35) 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[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e-87], t$95$1, If[LessEqual[t, 9e+35], 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(a, 120, \frac{\left(x - y\right) \cdot -60}{t}\right)\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.50000000000000008e-87 or 8.9999999999999993e35 < t Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
Applied rewrites89.6%
if -1.50000000000000008e-87 < t < 8.9999999999999993e35Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6487.2
Applied rewrites87.2%
Final simplification88.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ (- x y) t) (* a 120.0))))
(if (<= t -1.5e-87)
t_1
(if (<= t 9e+35) (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 <= -1.5e-87) {
tmp = t_1;
} else if (t <= 9e+35) {
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 <= -1.5e-87) tmp = t_1; elseif (t <= 9e+35) 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, -1.5e-87], t$95$1, If[LessEqual[t, 9e+35], 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 -1.5 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.50000000000000008e-87 or 8.9999999999999993e35 < t Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
if -1.50000000000000008e-87 < t < 8.9999999999999993e35Initial program 99.8%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6487.2
Applied rewrites87.2%
Final simplification88.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ 60.0 t) (* a 120.0))))
(if (<= t -2.35e+58)
t_1
(if (<= t 1.05e+36) (fma -60.0 (/ y z) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (60.0 / t), (a * 120.0));
double tmp;
if (t <= -2.35e+58) {
tmp = t_1;
} else if (t <= 1.05e+36) {
tmp = fma(-60.0, (y / z), (a * 120.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(60.0 / t), Float64(a * 120.0)) tmp = 0.0 if (t <= -2.35e+58) tmp = t_1; elseif (t <= 1.05e+36) tmp = fma(-60.0, Float64(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[(y * N[(60.0 / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.35e+58], t$95$1, If[LessEqual[t, 1.05e+36], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{60}{t}, a \cdot 120\right)\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+36}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, a \cdot 120\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.34999999999999986e58 or 1.05000000000000002e36 < t Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6492.4
Applied rewrites92.4%
Taylor expanded in x around 0
Applied rewrites82.0%
if -2.34999999999999986e58 < t < 1.05000000000000002e36Initial program 99.7%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6481.8
Applied rewrites81.8%
Taylor expanded in x around 0
Applied rewrites62.6%
Final simplification71.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma y (/ 60.0 t) (* a 120.0))))
(if (<= t -9.5e+101)
t_1
(if (<= t 1.35e+32) (fma a 120.0 (* x (/ 60.0 z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(y, (60.0 / t), (a * 120.0));
double tmp;
if (t <= -9.5e+101) {
tmp = t_1;
} else if (t <= 1.35e+32) {
tmp = fma(a, 120.0, (x * (60.0 / z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(y, Float64(60.0 / t), Float64(a * 120.0)) tmp = 0.0 if (t <= -9.5e+101) tmp = t_1; elseif (t <= 1.35e+32) tmp = fma(a, 120.0, Float64(x * Float64(60.0 / z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(60.0 / t), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e+101], t$95$1, If[LessEqual[t, 1.35e+32], N[(a * 120.0 + N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{60}{t}, a \cdot 120\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, x \cdot \frac{60}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.49999999999999947e101 or 1.35000000000000006e32 < t Initial program 99.7%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6495.5
Applied rewrites95.5%
Taylor expanded in x around 0
Applied rewrites83.2%
if -9.49999999999999947e101 < t < 1.35000000000000006e32Initial program 99.7%
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 y around 0
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-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6469.8
Applied rewrites69.8%
Taylor expanded in t around 0
Applied rewrites60.0%
Applied rewrites60.0%
Final simplification70.1%
(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.7%
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 (* 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.7%
Taylor expanded in z around inf
lower-*.f6449.3
Applied rewrites49.3%
Final simplification49.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 2024238
(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)))