
(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 15 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 (- z t)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) * (60.0 / (z - t))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) * Float64(60.0 / Float64(z - t)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \left(x - y\right) \cdot \frac{60}{z - t}\right)
\end{array}
Initial program 99.1%
associate-/l*99.8%
Simplified99.8%
+-commutative99.8%
fma-define99.8%
associate-*r/99.1%
*-commutative99.1%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* 60.0 (/ x z)))))
(if (<= z -6.5e+36)
t_1
(if (<= z -1.8e-6)
(* (- x y) (/ 60.0 (- z t)))
(if (<= z 5.2e-68)
(+ (* a 120.0) (* -60.0 (/ (- x y) t)))
(if (<= z 2.0)
(/ (* (- x y) 60.0) (- z t))
(if (<= z 1.45e+292) (+ (* a 120.0) (* -60.0 (/ y z))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (60.0 * (x / z));
double tmp;
if (z <= -6.5e+36) {
tmp = t_1;
} else if (z <= -1.8e-6) {
tmp = (x - y) * (60.0 / (z - t));
} else if (z <= 5.2e-68) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (z <= 2.0) {
tmp = ((x - y) * 60.0) / (z - t);
} else if (z <= 1.45e+292) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} 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) :: tmp
t_1 = (a * 120.0d0) + (60.0d0 * (x / z))
if (z <= (-6.5d+36)) then
tmp = t_1
else if (z <= (-1.8d-6)) then
tmp = (x - y) * (60.0d0 / (z - t))
else if (z <= 5.2d-68) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else if (z <= 2.0d0) then
tmp = ((x - y) * 60.0d0) / (z - t)
else if (z <= 1.45d+292) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
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 = (a * 120.0) + (60.0 * (x / z));
double tmp;
if (z <= -6.5e+36) {
tmp = t_1;
} else if (z <= -1.8e-6) {
tmp = (x - y) * (60.0 / (z - t));
} else if (z <= 5.2e-68) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (z <= 2.0) {
tmp = ((x - y) * 60.0) / (z - t);
} else if (z <= 1.45e+292) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (60.0 * (x / z)) tmp = 0 if z <= -6.5e+36: tmp = t_1 elif z <= -1.8e-6: tmp = (x - y) * (60.0 / (z - t)) elif z <= 5.2e-68: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) elif z <= 2.0: tmp = ((x - y) * 60.0) / (z - t) elif z <= 1.45e+292: tmp = (a * 120.0) + (-60.0 * (y / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z))) tmp = 0.0 if (z <= -6.5e+36) tmp = t_1; elseif (z <= -1.8e-6) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); elseif (z <= 5.2e-68) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); elseif (z <= 2.0) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)); elseif (z <= 1.45e+292) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (60.0 * (x / z)); tmp = 0.0; if (z <= -6.5e+36) tmp = t_1; elseif (z <= -1.8e-6) tmp = (x - y) * (60.0 / (z - t)); elseif (z <= 5.2e-68) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); elseif (z <= 2.0) tmp = ((x - y) * 60.0) / (z - t); elseif (z <= 1.45e+292) tmp = (a * 120.0) + (-60.0 * (y / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e+36], t$95$1, If[LessEqual[z, -1.8e-6], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e-68], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.0], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+292], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + 60 \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-6}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-68}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{elif}\;z \leq 2:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+292}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.4999999999999998e36 or 1.44999999999999995e292 < z Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 86.3%
Taylor expanded in x around inf 80.9%
if -6.4999999999999998e36 < z < -1.79999999999999992e-6Initial program 99.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*r/99.7%
remove-double-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
distribute-neg-frac299.6%
distribute-lft-in99.6%
+-commutative99.6%
sub-neg99.6%
div-sub99.6%
*-commutative99.6%
associate-*l/99.5%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in a around 0 93.4%
associate-*r/93.3%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if -1.79999999999999992e-6 < z < 5.1999999999999996e-68Initial program 98.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 92.6%
if 5.1999999999999996e-68 < z < 2Initial program 99.9%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.7%
associate-*r/99.7%
remove-double-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
distribute-neg-frac299.7%
distribute-lft-in99.7%
+-commutative99.7%
sub-neg99.7%
div-sub99.6%
*-commutative99.6%
associate-*l/99.9%
associate-*r/99.3%
Simplified99.3%
Taylor expanded in a around 0 73.9%
associate-*r/74.2%
Simplified74.2%
if 2 < z < 1.44999999999999995e292Initial program 99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 87.7%
Taylor expanded in x around 0 80.7%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -400000000.0)
(* a 120.0)
(if (<= (* a 120.0) 4e-52)
(* (- x y) (/ 60.0 (- z t)))
(if (<= (* a 120.0) 1.1e+189)
(+ (* a 120.0) (/ (* 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) <= -400000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 4e-52) {
tmp = (x - y) * (60.0 / (z - t));
} else if ((a * 120.0) <= 1.1e+189) {
tmp = (a * 120.0) + ((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) <= (-400000000.0d0)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 4d-52) then
tmp = (x - y) * (60.0d0 / (z - t))
else if ((a * 120.0d0) <= 1.1d+189) then
tmp = (a * 120.0d0) + ((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) <= -400000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 4e-52) {
tmp = (x - y) * (60.0 / (z - t));
} else if ((a * 120.0) <= 1.1e+189) {
tmp = (a * 120.0) + ((y * 60.0) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -400000000.0: tmp = a * 120.0 elif (a * 120.0) <= 4e-52: tmp = (x - y) * (60.0 / (z - t)) elif (a * 120.0) <= 1.1e+189: tmp = (a * 120.0) + ((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) <= -400000000.0) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 4e-52) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); elseif (Float64(a * 120.0) <= 1.1e+189) tmp = Float64(Float64(a * 120.0) + Float64(Float64(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) <= -400000000.0) tmp = a * 120.0; elseif ((a * 120.0) <= 4e-52) tmp = (x - y) * (60.0 / (z - t)); elseif ((a * 120.0) <= 1.1e+189) tmp = (a * 120.0) + ((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], -400000000.0], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 4e-52], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1.1e+189], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * 60.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -400000000:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 4 \cdot 10^{-52}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{elif}\;a \cdot 120 \leq 1.1 \cdot 10^{+189}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot 60}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a 120) < -4e8 or 1.10000000000000003e189 < (*.f64 a 120) Initial program 98.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 87.4%
if -4e8 < (*.f64 a 120) < 4e-52Initial program 98.9%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*r/99.7%
remove-double-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
distribute-neg-frac299.6%
distribute-lft-in99.6%
+-commutative99.6%
sub-neg99.6%
div-sub99.6%
*-commutative99.6%
associate-*l/98.9%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in a around 0 78.0%
associate-*r/77.3%
associate-*l/78.0%
*-commutative78.0%
Simplified78.0%
if 4e-52 < (*.f64 a 120) < 1.10000000000000003e189Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 83.0%
associate-*r/83.0%
*-commutative83.0%
associate-/l*83.0%
Simplified83.0%
Taylor expanded in x around 0 76.4%
*-commutative76.4%
associate-*l/76.4%
Simplified76.4%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* 60.0 (/ (- x y) z)))))
(if (<= z -2.4e+46)
t_1
(if (<= z -1.6e-6)
(* (- x y) (/ 60.0 (- z t)))
(if (<= z 3.9e-29) (+ (* a 120.0) (* -60.0 (/ (- x y) t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (60.0 * ((x - y) / z));
double tmp;
if (z <= -2.4e+46) {
tmp = t_1;
} else if (z <= -1.6e-6) {
tmp = (x - y) * (60.0 / (z - t));
} else if (z <= 3.9e-29) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} 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) :: tmp
t_1 = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
if (z <= (-2.4d+46)) then
tmp = t_1
else if (z <= (-1.6d-6)) then
tmp = (x - y) * (60.0d0 / (z - t))
else if (z <= 3.9d-29) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
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 = (a * 120.0) + (60.0 * ((x - y) / z));
double tmp;
if (z <= -2.4e+46) {
tmp = t_1;
} else if (z <= -1.6e-6) {
tmp = (x - y) * (60.0 / (z - t));
} else if (z <= 3.9e-29) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (60.0 * ((x - y) / z)) tmp = 0 if z <= -2.4e+46: tmp = t_1 elif z <= -1.6e-6: tmp = (x - y) * (60.0 / (z - t)) elif z <= 3.9e-29: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))) tmp = 0.0 if (z <= -2.4e+46) tmp = t_1; elseif (z <= -1.6e-6) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); elseif (z <= 3.9e-29) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (60.0 * ((x - y) / z)); tmp = 0.0; if (z <= -2.4e+46) tmp = t_1; elseif (z <= -1.6e-6) tmp = (x - y) * (60.0 / (z - t)); elseif (z <= 3.9e-29) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+46], t$95$1, If[LessEqual[z, -1.6e-6], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e-29], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-6}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-29}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.40000000000000008e46 or 3.8999999999999998e-29 < z Initial program 99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 87.7%
if -2.40000000000000008e46 < z < -1.5999999999999999e-6Initial program 99.4%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*r/99.6%
remove-double-neg99.6%
neg-mul-199.6%
times-frac99.5%
metadata-eval99.5%
distribute-neg-frac299.5%
distribute-lft-in99.5%
+-commutative99.5%
sub-neg99.5%
div-sub99.5%
*-commutative99.5%
associate-*l/99.4%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in a around 0 88.3%
associate-*r/88.2%
associate-*l/88.6%
*-commutative88.6%
Simplified88.6%
if -1.5999999999999999e-6 < z < 3.8999999999999998e-29Initial program 98.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 91.0%
Final simplification89.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* 60.0 (/ (- x y) z)))))
(if (<= z -3.6e+48)
t_1
(if (<= z -2.1e-6)
(* (- x y) (/ 60.0 (- z t)))
(if (<= z 9.2e-26) (+ (* a 120.0) (* (- x y) (/ -60.0 t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (60.0 * ((x - y) / z));
double tmp;
if (z <= -3.6e+48) {
tmp = t_1;
} else if (z <= -2.1e-6) {
tmp = (x - y) * (60.0 / (z - t));
} else if (z <= 9.2e-26) {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
} 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) :: tmp
t_1 = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
if (z <= (-3.6d+48)) then
tmp = t_1
else if (z <= (-2.1d-6)) then
tmp = (x - y) * (60.0d0 / (z - t))
else if (z <= 9.2d-26) then
tmp = (a * 120.0d0) + ((x - y) * ((-60.0d0) / t))
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 = (a * 120.0) + (60.0 * ((x - y) / z));
double tmp;
if (z <= -3.6e+48) {
tmp = t_1;
} else if (z <= -2.1e-6) {
tmp = (x - y) * (60.0 / (z - t));
} else if (z <= 9.2e-26) {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (60.0 * ((x - y) / z)) tmp = 0 if z <= -3.6e+48: tmp = t_1 elif z <= -2.1e-6: tmp = (x - y) * (60.0 / (z - t)) elif z <= 9.2e-26: tmp = (a * 120.0) + ((x - y) * (-60.0 / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))) tmp = 0.0 if (z <= -3.6e+48) tmp = t_1; elseif (z <= -2.1e-6) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); elseif (z <= 9.2e-26) tmp = Float64(Float64(a * 120.0) + Float64(Float64(x - y) * Float64(-60.0 / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (60.0 * ((x - y) / z)); tmp = 0.0; if (z <= -3.6e+48) tmp = t_1; elseif (z <= -2.1e-6) tmp = (x - y) * (60.0 / (z - t)); elseif (z <= 9.2e-26) tmp = (a * 120.0) + ((x - y) * (-60.0 / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e+48], t$95$1, If[LessEqual[z, -2.1e-6], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-26], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-6}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-26}:\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.59999999999999983e48 or 9.20000000000000035e-26 < z Initial program 99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 87.7%
if -3.59999999999999983e48 < z < -2.0999999999999998e-6Initial program 99.4%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*r/99.6%
remove-double-neg99.6%
neg-mul-199.6%
times-frac99.5%
metadata-eval99.5%
distribute-neg-frac299.5%
distribute-lft-in99.5%
+-commutative99.5%
sub-neg99.5%
div-sub99.5%
*-commutative99.5%
associate-*l/99.4%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in a around 0 88.3%
associate-*r/88.2%
associate-*l/88.6%
*-commutative88.6%
Simplified88.6%
if -2.0999999999999998e-6 < z < 9.20000000000000035e-26Initial program 98.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 91.0%
associate-*r/89.4%
*-commutative89.4%
associate-/l*91.0%
Simplified91.0%
Final simplification89.3%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -400000000.0)
(* a 120.0)
(if (<= (* a 120.0) 1e-65)
(* (- x y) (/ 60.0 (- z t)))
(+ (* a 120.0) (* -60.0 (/ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -400000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-65) {
tmp = (x - y) * (60.0 / (z - t));
} else {
tmp = (a * 120.0) + (-60.0 * (x / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a * 120.0d0) <= (-400000000.0d0)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 1d-65) then
tmp = (x - y) * (60.0d0 / (z - t))
else
tmp = (a * 120.0d0) + ((-60.0d0) * (x / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -400000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 1e-65) {
tmp = (x - y) * (60.0 / (z - t));
} else {
tmp = (a * 120.0) + (-60.0 * (x / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -400000000.0: tmp = a * 120.0 elif (a * 120.0) <= 1e-65: tmp = (x - y) * (60.0 / (z - t)) else: tmp = (a * 120.0) + (-60.0 * (x / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -400000000.0) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 1e-65) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(x / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -400000000.0) tmp = a * 120.0; elseif ((a * 120.0) <= 1e-65) tmp = (x - y) * (60.0 / (z - t)); else tmp = (a * 120.0) + (-60.0 * (x / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -400000000.0], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-65], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -400000000:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-65}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if (*.f64 a 120) < -4e8Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 83.7%
if -4e8 < (*.f64 a 120) < 9.99999999999999923e-66Initial program 99.7%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*r/99.7%
remove-double-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
distribute-neg-frac299.6%
distribute-lft-in99.6%
+-commutative99.6%
sub-neg99.6%
div-sub99.6%
*-commutative99.6%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in a around 0 77.6%
associate-*r/77.7%
associate-*l/77.7%
*-commutative77.7%
Simplified77.7%
if 9.99999999999999923e-66 < (*.f64 a 120) Initial program 97.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 89.8%
associate-*r/87.4%
Simplified87.4%
Taylor expanded in z around 0 77.7%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -4.8e+69) (not (<= x 1.3e+36))) (+ (* a 120.0) (/ (* x 60.0) (- z t))) (+ (* a 120.0) (/ (* y -60.0) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4.8e+69) || !(x <= 1.3e+36)) {
tmp = (a * 120.0) + ((x * 60.0) / (z - t));
} else {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-4.8d+69)) .or. (.not. (x <= 1.3d+36))) then
tmp = (a * 120.0d0) + ((x * 60.0d0) / (z - t))
else
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4.8e+69) || !(x <= 1.3e+36)) {
tmp = (a * 120.0) + ((x * 60.0) / (z - t));
} else {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -4.8e+69) or not (x <= 1.3e+36): tmp = (a * 120.0) + ((x * 60.0) / (z - t)) else: tmp = (a * 120.0) + ((y * -60.0) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -4.8e+69) || !(x <= 1.3e+36)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(x * 60.0) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -4.8e+69) || ~((x <= 1.3e+36))) tmp = (a * 120.0) + ((x * 60.0) / (z - t)); else tmp = (a * 120.0) + ((y * -60.0) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -4.8e+69], N[Not[LessEqual[x, 1.3e+36]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+69} \lor \neg \left(x \leq 1.3 \cdot 10^{+36}\right):\\
\;\;\;\;a \cdot 120 + \frac{x \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\end{array}
\end{array}
if x < -4.8000000000000003e69 or 1.3000000000000001e36 < x Initial program 98.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 89.5%
associate-*r/87.8%
Simplified87.8%
if -4.8000000000000003e69 < x < 1.3000000000000001e36Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 93.6%
associate-*r/93.6%
Simplified93.6%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -860000.0) (not (<= a 6.2e-51))) (* a 120.0) (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -860000.0) || !(a <= 6.2e-51)) {
tmp = a * 120.0;
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-860000.0d0)) .or. (.not. (a <= 6.2d-51))) then
tmp = a * 120.0d0
else
tmp = (x - y) * (60.0d0 / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -860000.0) || !(a <= 6.2e-51)) {
tmp = a * 120.0;
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -860000.0) or not (a <= 6.2e-51): tmp = a * 120.0 else: tmp = (x - y) * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -860000.0) || !(a <= 6.2e-51)) tmp = Float64(a * 120.0); else tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -860000.0) || ~((a <= 6.2e-51))) tmp = a * 120.0; else tmp = (x - y) * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -860000.0], N[Not[LessEqual[a, 6.2e-51]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -860000 \lor \neg \left(a \leq 6.2 \cdot 10^{-51}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if a < -8.6e5 or 6.1999999999999995e-51 < a Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 80.1%
if -8.6e5 < a < 6.1999999999999995e-51Initial program 98.9%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*r/99.7%
remove-double-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
distribute-neg-frac299.6%
distribute-lft-in99.6%
+-commutative99.6%
sub-neg99.6%
div-sub99.6%
*-commutative99.6%
associate-*l/98.9%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in a around 0 78.0%
associate-*r/77.3%
associate-*l/78.0%
*-commutative78.0%
Simplified78.0%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.35e-127) (not (<= a 9.6e-164))) (* a 120.0) (* -60.0 (/ y (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.35e-127) || !(a <= 9.6e-164)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.35d-127)) .or. (.not. (a <= 9.6d-164))) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (y / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.35e-127) || !(a <= 9.6e-164)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.35e-127) or not (a <= 9.6e-164): tmp = a * 120.0 else: tmp = -60.0 * (y / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.35e-127) || !(a <= 9.6e-164)) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(y / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.35e-127) || ~((a <= 9.6e-164))) tmp = a * 120.0; else tmp = -60.0 * (y / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.35e-127], N[Not[LessEqual[a, 9.6e-164]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{-127} \lor \neg \left(a \leq 9.6 \cdot 10^{-164}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\end{array}
\end{array}
if a < -1.35e-127 or 9.59999999999999932e-164 < a Initial program 98.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 67.2%
if -1.35e-127 < a < 9.59999999999999932e-164Initial program 99.7%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*r/99.7%
remove-double-neg99.7%
neg-mul-199.7%
times-frac99.5%
metadata-eval99.5%
distribute-neg-frac299.5%
distribute-lft-in99.5%
+-commutative99.5%
sub-neg99.5%
div-sub99.5%
*-commutative99.5%
associate-*l/99.7%
associate-*r/99.6%
Simplified99.6%
Taylor expanded in y around inf 44.1%
Final simplification61.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.75e-113) (not (<= a 1.45e-52))) (* a 120.0) (* 60.0 (/ x (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.75e-113) || !(a <= 1.45e-52)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (x / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.75d-113)) .or. (.not. (a <= 1.45d-52))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (x / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.75e-113) || !(a <= 1.45e-52)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (x / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.75e-113) or not (a <= 1.45e-52): tmp = a * 120.0 else: tmp = 60.0 * (x / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.75e-113) || !(a <= 1.45e-52)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(x / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.75e-113) || ~((a <= 1.45e-52))) tmp = a * 120.0; else tmp = 60.0 * (x / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.75e-113], N[Not[LessEqual[a, 1.45e-52]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{-113} \lor \neg \left(a \leq 1.45 \cdot 10^{-52}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if a < -1.75000000000000014e-113 or 1.4500000000000001e-52 < a Initial program 99.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 73.9%
if -1.75000000000000014e-113 < a < 1.4500000000000001e-52Initial program 98.7%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*r/99.7%
remove-double-neg99.7%
neg-mul-199.7%
times-frac99.5%
metadata-eval99.5%
distribute-neg-frac299.5%
distribute-lft-in99.5%
+-commutative99.5%
sub-neg99.5%
div-sub99.5%
*-commutative99.5%
associate-*l/98.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in x around inf 51.0%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -6.2e+162) (* 60.0 (/ x z)) (if (<= x 5.2e+207) (* a 120.0) (* -60.0 (/ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.2e+162) {
tmp = 60.0 * (x / z);
} else if (x <= 5.2e+207) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-6.2d+162)) then
tmp = 60.0d0 * (x / z)
else if (x <= 5.2d+207) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6.2e+162) {
tmp = 60.0 * (x / z);
} else if (x <= 5.2e+207) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6.2e+162: tmp = 60.0 * (x / z) elif x <= 5.2e+207: tmp = a * 120.0 else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.2e+162) tmp = Float64(60.0 * Float64(x / z)); elseif (x <= 5.2e+207) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6.2e+162) tmp = 60.0 * (x / z); elseif (x <= 5.2e+207) tmp = a * 120.0; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.2e+162], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+207], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+162}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+207}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if x < -6.1999999999999999e162Initial program 97.1%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around inf 58.2%
Taylor expanded in x around inf 45.7%
if -6.1999999999999999e162 < x < 5.1999999999999996e207Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 63.2%
if 5.1999999999999996e207 < x Initial program 95.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 92.5%
associate-*r/87.7%
Simplified87.7%
Taylor expanded in z around 0 71.5%
Taylor expanded in x around inf 61.8%
Final simplification60.7%
(FPCore (x y z t a) :precision binary64 (+ (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
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) + (60.0d0 * ((x - y) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
def code(x, y, z, t, a): return (a * 120.0) + (60.0 * ((x - y) / (z - t)))
function code(x, y, z, t, a) return Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = (a * 120.0) + (60.0 * ((x - y) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120 + 60 \cdot \frac{x - y}{z - t}
\end{array}
Initial program 99.1%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (+ (* (- x y) (/ 60.0 (- z t))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((x - y) * (60.0 / (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 = ((x - y) * (60.0d0 / (z - t))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x - y) * (60.0 / (z - t))) + (a * 120.0);
}
def code(x, y, z, t, a): return ((x - y) * (60.0 / (z - t))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x - y) * (60.0 / (z - t))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - y\right) \cdot \frac{60}{z - t} + a \cdot 120
\end{array}
Initial program 99.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
associate-*r/99.8%
remove-double-neg99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
distribute-neg-frac299.8%
distribute-lft-in99.8%
+-commutative99.8%
sub-neg99.8%
div-sub99.8%
*-commutative99.8%
associate-*l/99.1%
associate-*r/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (<= x 1.02e+207) (* a 120.0) (* -60.0 (/ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 1.02e+207) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= 1.02d+207) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 1.02e+207) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= 1.02e+207: tmp = a * 120.0 else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= 1.02e+207) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= 1.02e+207) tmp = a * 120.0; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, 1.02e+207], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.02 \cdot 10^{+207}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if x < 1.0200000000000001e207Initial program 99.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 57.2%
if 1.0200000000000001e207 < x Initial program 95.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 92.5%
associate-*r/87.7%
Simplified87.7%
Taylor expanded in z around 0 71.5%
Taylor expanded in x around inf 61.8%
Final simplification57.5%
(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%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 54.0%
Final simplification54.0%
(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 2024044
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:herbie-target
(+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))