
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (* (/ 60.0 (- z t)) (- x y))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((60.0 / (z - t)) * (x - y)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)
\end{array}
Initial program 99.4%
+-commutative99.4%
fma-def99.5%
associate-*l/99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (/ -60.0 (/ z y))))
(t_2 (+ (* a 120.0) (* -60.0 (/ x t))))
(t_3 (* 60.0 (/ x (- z t)))))
(if (<= t -5.6e+17)
t_2
(if (<= t 6.2e-189)
t_1
(if (<= t 1.45e-103)
t_3
(if (<= t 5e-81)
t_1
(if (<= t 0.022)
t_3
(if (<= t 3.1e+29)
t_1
(if (<= t 5.6e+68)
(* (/ 60.0 (- z t)) x)
(if (<= t 7e+218)
(+ (* a 120.0) (* 60.0 (/ y t)))
t_2))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (-60.0 / (z / y));
double t_2 = (a * 120.0) + (-60.0 * (x / t));
double t_3 = 60.0 * (x / (z - t));
double tmp;
if (t <= -5.6e+17) {
tmp = t_2;
} else if (t <= 6.2e-189) {
tmp = t_1;
} else if (t <= 1.45e-103) {
tmp = t_3;
} else if (t <= 5e-81) {
tmp = t_1;
} else if (t <= 0.022) {
tmp = t_3;
} else if (t <= 3.1e+29) {
tmp = t_1;
} else if (t <= 5.6e+68) {
tmp = (60.0 / (z - t)) * x;
} else if (t <= 7e+218) {
tmp = (a * 120.0) + (60.0 * (y / t));
} 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 = (a * 120.0d0) + ((-60.0d0) / (z / y))
t_2 = (a * 120.0d0) + ((-60.0d0) * (x / t))
t_3 = 60.0d0 * (x / (z - t))
if (t <= (-5.6d+17)) then
tmp = t_2
else if (t <= 6.2d-189) then
tmp = t_1
else if (t <= 1.45d-103) then
tmp = t_3
else if (t <= 5d-81) then
tmp = t_1
else if (t <= 0.022d0) then
tmp = t_3
else if (t <= 3.1d+29) then
tmp = t_1
else if (t <= 5.6d+68) then
tmp = (60.0d0 / (z - t)) * x
else if (t <= 7d+218) then
tmp = (a * 120.0d0) + (60.0d0 * (y / t))
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 = (a * 120.0) + (-60.0 / (z / y));
double t_2 = (a * 120.0) + (-60.0 * (x / t));
double t_3 = 60.0 * (x / (z - t));
double tmp;
if (t <= -5.6e+17) {
tmp = t_2;
} else if (t <= 6.2e-189) {
tmp = t_1;
} else if (t <= 1.45e-103) {
tmp = t_3;
} else if (t <= 5e-81) {
tmp = t_1;
} else if (t <= 0.022) {
tmp = t_3;
} else if (t <= 3.1e+29) {
tmp = t_1;
} else if (t <= 5.6e+68) {
tmp = (60.0 / (z - t)) * x;
} else if (t <= 7e+218) {
tmp = (a * 120.0) + (60.0 * (y / t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (-60.0 / (z / y)) t_2 = (a * 120.0) + (-60.0 * (x / t)) t_3 = 60.0 * (x / (z - t)) tmp = 0 if t <= -5.6e+17: tmp = t_2 elif t <= 6.2e-189: tmp = t_1 elif t <= 1.45e-103: tmp = t_3 elif t <= 5e-81: tmp = t_1 elif t <= 0.022: tmp = t_3 elif t <= 3.1e+29: tmp = t_1 elif t <= 5.6e+68: tmp = (60.0 / (z - t)) * x elif t <= 7e+218: tmp = (a * 120.0) + (60.0 * (y / t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(z / y))) t_2 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(x / t))) t_3 = Float64(60.0 * Float64(x / Float64(z - t))) tmp = 0.0 if (t <= -5.6e+17) tmp = t_2; elseif (t <= 6.2e-189) tmp = t_1; elseif (t <= 1.45e-103) tmp = t_3; elseif (t <= 5e-81) tmp = t_1; elseif (t <= 0.022) tmp = t_3; elseif (t <= 3.1e+29) tmp = t_1; elseif (t <= 5.6e+68) tmp = Float64(Float64(60.0 / Float64(z - t)) * x); elseif (t <= 7e+218) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (-60.0 / (z / y)); t_2 = (a * 120.0) + (-60.0 * (x / t)); t_3 = 60.0 * (x / (z - t)); tmp = 0.0; if (t <= -5.6e+17) tmp = t_2; elseif (t <= 6.2e-189) tmp = t_1; elseif (t <= 1.45e-103) tmp = t_3; elseif (t <= 5e-81) tmp = t_1; elseif (t <= 0.022) tmp = t_3; elseif (t <= 3.1e+29) tmp = t_1; elseif (t <= 5.6e+68) tmp = (60.0 / (z - t)) * x; elseif (t <= 7e+218) tmp = (a * 120.0) + (60.0 * (y / t)); else tmp = t_2; 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[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+17], t$95$2, If[LessEqual[t, 6.2e-189], t$95$1, If[LessEqual[t, 1.45e-103], t$95$3, If[LessEqual[t, 5e-81], t$95$1, If[LessEqual[t, 0.022], t$95$3, If[LessEqual[t, 3.1e+29], t$95$1, If[LessEqual[t, 5.6e+68], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 7e+218], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + \frac{-60}{\frac{z}{y}}\\
t_2 := a \cdot 120 + -60 \cdot \frac{x}{t}\\
t_3 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-103}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 0.022:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{60}{z - t} \cdot x\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+218}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.6e17 or 7.00000000000000038e218 < t Initial program 99.8%
Taylor expanded in x around inf 90.1%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in z around 0 84.8%
if -5.6e17 < t < 6.2000000000000001e-189 or 1.4499999999999999e-103 < t < 4.99999999999999981e-81 or 0.021999999999999999 < t < 3.0999999999999999e29Initial program 99.9%
Taylor expanded in z around inf 88.9%
Taylor expanded in x around 0 71.0%
associate-*r/71.1%
associate-/l*71.0%
Simplified71.0%
if 6.2000000000000001e-189 < t < 1.4499999999999999e-103 or 4.99999999999999981e-81 < t < 0.021999999999999999Initial program 99.7%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 71.8%
if 3.0999999999999999e29 < t < 5.6e68Initial program 99.4%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 75.8%
associate-*r/75.4%
associate-*l/76.0%
*-commutative76.0%
Simplified76.0%
if 5.6e68 < t < 7.00000000000000038e218Initial program 96.5%
associate-*l/99.7%
Applied egg-rr99.7%
clear-num99.7%
associate-*l/99.8%
div-inv99.8%
*-un-lft-identity99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in x around 0 76.6%
Final simplification75.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (/ -60.0 (/ z y))))
(t_2 (+ (* a 120.0) (* -60.0 (/ (- x y) t)))))
(if (<= t -5.6e+17)
t_2
(if (<= t 6.2e-189)
t_1
(if (<= t 1.55e-103)
(* 60.0 (/ x (- z t)))
(if (or (<= t 1.25e-83) (and (not (<= t 0.6)) (<= t 1.4e+29)))
t_1
t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (-60.0 / (z / y));
double t_2 = (a * 120.0) + (-60.0 * ((x - y) / t));
double tmp;
if (t <= -5.6e+17) {
tmp = t_2;
} else if (t <= 6.2e-189) {
tmp = t_1;
} else if (t <= 1.55e-103) {
tmp = 60.0 * (x / (z - t));
} else if ((t <= 1.25e-83) || (!(t <= 0.6) && (t <= 1.4e+29))) {
tmp = t_1;
} 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) :: tmp
t_1 = (a * 120.0d0) + ((-60.0d0) / (z / y))
t_2 = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
if (t <= (-5.6d+17)) then
tmp = t_2
else if (t <= 6.2d-189) then
tmp = t_1
else if (t <= 1.55d-103) then
tmp = 60.0d0 * (x / (z - t))
else if ((t <= 1.25d-83) .or. (.not. (t <= 0.6d0)) .and. (t <= 1.4d+29)) then
tmp = t_1
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 = (a * 120.0) + (-60.0 / (z / y));
double t_2 = (a * 120.0) + (-60.0 * ((x - y) / t));
double tmp;
if (t <= -5.6e+17) {
tmp = t_2;
} else if (t <= 6.2e-189) {
tmp = t_1;
} else if (t <= 1.55e-103) {
tmp = 60.0 * (x / (z - t));
} else if ((t <= 1.25e-83) || (!(t <= 0.6) && (t <= 1.4e+29))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (-60.0 / (z / y)) t_2 = (a * 120.0) + (-60.0 * ((x - y) / t)) tmp = 0 if t <= -5.6e+17: tmp = t_2 elif t <= 6.2e-189: tmp = t_1 elif t <= 1.55e-103: tmp = 60.0 * (x / (z - t)) elif (t <= 1.25e-83) or (not (t <= 0.6) and (t <= 1.4e+29)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(z / y))) t_2 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))) tmp = 0.0 if (t <= -5.6e+17) tmp = t_2; elseif (t <= 6.2e-189) tmp = t_1; elseif (t <= 1.55e-103) tmp = Float64(60.0 * Float64(x / Float64(z - t))); elseif ((t <= 1.25e-83) || (!(t <= 0.6) && (t <= 1.4e+29))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (-60.0 / (z / y)); t_2 = (a * 120.0) + (-60.0 * ((x - y) / t)); tmp = 0.0; if (t <= -5.6e+17) tmp = t_2; elseif (t <= 6.2e-189) tmp = t_1; elseif (t <= 1.55e-103) tmp = 60.0 * (x / (z - t)); elseif ((t <= 1.25e-83) || (~((t <= 0.6)) && (t <= 1.4e+29))) tmp = t_1; else tmp = t_2; 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[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+17], t$95$2, If[LessEqual[t, 6.2e-189], t$95$1, If[LessEqual[t, 1.55e-103], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.25e-83], And[N[Not[LessEqual[t, 0.6]], $MachinePrecision], LessEqual[t, 1.4e+29]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + \frac{-60}{\frac{z}{y}}\\
t_2 := a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-103}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-83} \lor \neg \left(t \leq 0.6\right) \land t \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.6e17 or 1.25e-83 < t < 0.599999999999999978 or 1.4e29 < t Initial program 99.0%
Taylor expanded in z around 0 88.4%
if -5.6e17 < t < 6.2000000000000001e-189 or 1.5500000000000001e-103 < t < 1.25e-83 or 0.599999999999999978 < t < 1.4e29Initial program 99.9%
Taylor expanded in z around inf 88.9%
Taylor expanded in x around 0 71.0%
associate-*r/71.1%
associate-/l*71.0%
Simplified71.0%
if 6.2000000000000001e-189 < t < 1.5500000000000001e-103Initial program 99.6%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 74.4%
Final simplification79.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ y (- z t)))) (t_2 (* 60.0 (/ x (- z t)))))
(if (<= x -2.1e+61)
t_2
(if (<= x -7.2e-110)
(* a 120.0)
(if (<= x -5.6e-149)
t_1
(if (<= x 4.8e-18) (* a 120.0) (if (<= x 3.4e+78) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double t_2 = 60.0 * (x / (z - t));
double tmp;
if (x <= -2.1e+61) {
tmp = t_2;
} else if (x <= -7.2e-110) {
tmp = a * 120.0;
} else if (x <= -5.6e-149) {
tmp = t_1;
} else if (x <= 4.8e-18) {
tmp = a * 120.0;
} else if (x <= 3.4e+78) {
tmp = t_1;
} 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) :: tmp
t_1 = (-60.0d0) * (y / (z - t))
t_2 = 60.0d0 * (x / (z - t))
if (x <= (-2.1d+61)) then
tmp = t_2
else if (x <= (-7.2d-110)) then
tmp = a * 120.0d0
else if (x <= (-5.6d-149)) then
tmp = t_1
else if (x <= 4.8d-18) then
tmp = a * 120.0d0
else if (x <= 3.4d+78) then
tmp = t_1
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 = -60.0 * (y / (z - t));
double t_2 = 60.0 * (x / (z - t));
double tmp;
if (x <= -2.1e+61) {
tmp = t_2;
} else if (x <= -7.2e-110) {
tmp = a * 120.0;
} else if (x <= -5.6e-149) {
tmp = t_1;
} else if (x <= 4.8e-18) {
tmp = a * 120.0;
} else if (x <= 3.4e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) t_2 = 60.0 * (x / (z - t)) tmp = 0 if x <= -2.1e+61: tmp = t_2 elif x <= -7.2e-110: tmp = a * 120.0 elif x <= -5.6e-149: tmp = t_1 elif x <= 4.8e-18: tmp = a * 120.0 elif x <= 3.4e+78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) t_2 = Float64(60.0 * Float64(x / Float64(z - t))) tmp = 0.0 if (x <= -2.1e+61) tmp = t_2; elseif (x <= -7.2e-110) tmp = Float64(a * 120.0); elseif (x <= -5.6e-149) tmp = t_1; elseif (x <= 4.8e-18) tmp = Float64(a * 120.0); elseif (x <= 3.4e+78) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (y / (z - t)); t_2 = 60.0 * (x / (z - t)); tmp = 0.0; if (x <= -2.1e+61) tmp = t_2; elseif (x <= -7.2e-110) tmp = a * 120.0; elseif (x <= -5.6e-149) tmp = t_1; elseif (x <= 4.8e-18) tmp = a * 120.0; elseif (x <= 3.4e+78) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+61], t$95$2, If[LessEqual[x, -7.2e-110], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, -5.6e-149], t$95$1, If[LessEqual[x, 4.8e-18], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, 3.4e+78], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
t_2 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-110}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-149}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-18}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.1000000000000001e61 or 3.40000000000000007e78 < x Initial program 98.8%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 69.1%
if -2.1000000000000001e61 < x < -7.1999999999999999e-110 or -5.5999999999999997e-149 < x < 4.79999999999999988e-18Initial program 99.9%
Taylor expanded in z around inf 64.0%
if -7.1999999999999999e-110 < x < -5.5999999999999997e-149 or 4.79999999999999988e-18 < x < 3.40000000000000007e78Initial program 99.8%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.0%
Final simplification66.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ -60.0 (/ (- z t) y))) (t_2 (* 60.0 (/ x (- z t)))))
(if (<= x -2.9e+60)
t_2
(if (<= x -6.4e-108)
(* a 120.0)
(if (<= x -1.8e-147)
t_1
(if (<= x 3.45e-18) (* a 120.0) (if (<= x 3.3e+78) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 / ((z - t) / y);
double t_2 = 60.0 * (x / (z - t));
double tmp;
if (x <= -2.9e+60) {
tmp = t_2;
} else if (x <= -6.4e-108) {
tmp = a * 120.0;
} else if (x <= -1.8e-147) {
tmp = t_1;
} else if (x <= 3.45e-18) {
tmp = a * 120.0;
} else if (x <= 3.3e+78) {
tmp = t_1;
} 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) :: tmp
t_1 = (-60.0d0) / ((z - t) / y)
t_2 = 60.0d0 * (x / (z - t))
if (x <= (-2.9d+60)) then
tmp = t_2
else if (x <= (-6.4d-108)) then
tmp = a * 120.0d0
else if (x <= (-1.8d-147)) then
tmp = t_1
else if (x <= 3.45d-18) then
tmp = a * 120.0d0
else if (x <= 3.3d+78) then
tmp = t_1
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 = -60.0 / ((z - t) / y);
double t_2 = 60.0 * (x / (z - t));
double tmp;
if (x <= -2.9e+60) {
tmp = t_2;
} else if (x <= -6.4e-108) {
tmp = a * 120.0;
} else if (x <= -1.8e-147) {
tmp = t_1;
} else if (x <= 3.45e-18) {
tmp = a * 120.0;
} else if (x <= 3.3e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 / ((z - t) / y) t_2 = 60.0 * (x / (z - t)) tmp = 0 if x <= -2.9e+60: tmp = t_2 elif x <= -6.4e-108: tmp = a * 120.0 elif x <= -1.8e-147: tmp = t_1 elif x <= 3.45e-18: tmp = a * 120.0 elif x <= 3.3e+78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 / Float64(Float64(z - t) / y)) t_2 = Float64(60.0 * Float64(x / Float64(z - t))) tmp = 0.0 if (x <= -2.9e+60) tmp = t_2; elseif (x <= -6.4e-108) tmp = Float64(a * 120.0); elseif (x <= -1.8e-147) tmp = t_1; elseif (x <= 3.45e-18) tmp = Float64(a * 120.0); elseif (x <= 3.3e+78) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 / ((z - t) / y); t_2 = 60.0 * (x / (z - t)); tmp = 0.0; if (x <= -2.9e+60) tmp = t_2; elseif (x <= -6.4e-108) tmp = a * 120.0; elseif (x <= -1.8e-147) tmp = t_1; elseif (x <= 3.45e-18) tmp = a * 120.0; elseif (x <= 3.3e+78) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 / N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+60], t$95$2, If[LessEqual[x, -6.4e-108], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, -1.8e-147], t$95$1, If[LessEqual[x, 3.45e-18], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, 3.3e+78], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-60}{\frac{z - t}{y}}\\
t_2 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+60}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-108}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.45 \cdot 10^{-18}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.9e60 or 3.3e78 < x Initial program 98.8%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 69.1%
if -2.9e60 < x < -6.3999999999999999e-108 or -1.80000000000000006e-147 < x < 3.4500000000000001e-18Initial program 99.9%
Taylor expanded in z around inf 64.0%
if -6.3999999999999999e-108 < x < -1.80000000000000006e-147 or 3.4500000000000001e-18 < x < 3.3e78Initial program 99.8%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.0%
associate-*r/68.0%
associate-/l*68.1%
Applied egg-rr68.1%
Final simplification66.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ y (- z t)))))
(if (<= y -2.3e+54)
t_1
(if (<= y -0.48)
(* a 120.0)
(if (<= y -2.1e-63)
(* 60.0 (/ x z))
(if (<= y 1.3e+77) (* a 120.0) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -2.3e+54) {
tmp = t_1;
} else if (y <= -0.48) {
tmp = a * 120.0;
} else if (y <= -2.1e-63) {
tmp = 60.0 * (x / z);
} else if (y <= 1.3e+77) {
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) :: tmp
t_1 = (-60.0d0) * (y / (z - t))
if (y <= (-2.3d+54)) then
tmp = t_1
else if (y <= (-0.48d0)) then
tmp = a * 120.0d0
else if (y <= (-2.1d-63)) then
tmp = 60.0d0 * (x / z)
else if (y <= 1.3d+77) then
tmp = a * 120.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -2.3e+54) {
tmp = t_1;
} else if (y <= -0.48) {
tmp = a * 120.0;
} else if (y <= -2.1e-63) {
tmp = 60.0 * (x / z);
} else if (y <= 1.3e+77) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) tmp = 0 if y <= -2.3e+54: tmp = t_1 elif y <= -0.48: tmp = a * 120.0 elif y <= -2.1e-63: tmp = 60.0 * (x / z) elif y <= 1.3e+77: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -2.3e+54) tmp = t_1; elseif (y <= -0.48) tmp = Float64(a * 120.0); elseif (y <= -2.1e-63) tmp = Float64(60.0 * Float64(x / z)); elseif (y <= 1.3e+77) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (y / (z - t)); tmp = 0.0; if (y <= -2.3e+54) tmp = t_1; elseif (y <= -0.48) tmp = a * 120.0; elseif (y <= -2.1e-63) tmp = 60.0 * (x / z); elseif (y <= 1.3e+77) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e+54], t$95$1, If[LessEqual[y, -0.48], N[(a * 120.0), $MachinePrecision], If[LessEqual[y, -2.1e-63], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+77], N[(a * 120.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -0.48:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-63}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+77}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.29999999999999994e54 or 1.3000000000000001e77 < y Initial program 99.9%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 59.1%
if -2.29999999999999994e54 < y < -0.47999999999999998 or -2.1e-63 < y < 1.3000000000000001e77Initial program 99.2%
Taylor expanded in z around inf 56.9%
if -0.47999999999999998 < y < -2.1e-63Initial program 99.7%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 80.0%
associate-*r/80.2%
associate-*l/80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in z around inf 60.9%
Final simplification57.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.6e+17) (not (<= t 8.8e+18))) (+ (* a 120.0) (* -60.0 (/ (- x y) t))) (+ (* a 120.0) (* 60.0 (/ (- x y) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e+17) || !(t <= 8.8e+18)) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (60.0 * ((x - y) / 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) :: tmp
if ((t <= (-5.6d+17)) .or. (.not. (t <= 8.8d+18))) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else
tmp = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e+17) || !(t <= 8.8e+18)) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.6e+17) or not (t <= 8.8e+18): tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) else: tmp = (a * 120.0) + (60.0 * ((x - y) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.6e+17) || !(t <= 8.8e+18)) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.6e+17) || ~((t <= 8.8e+18))) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); else tmp = (a * 120.0) + (60.0 * ((x - y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.6e+17], N[Not[LessEqual[t, 8.8e+18]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+17} \lor \neg \left(t \leq 8.8 \cdot 10^{+18}\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if t < -5.6e17 or 8.8e18 < t Initial program 98.9%
Taylor expanded in z around 0 90.1%
if -5.6e17 < t < 8.8e18Initial program 99.8%
Taylor expanded in z around inf 82.6%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -960.0) (not (<= x 1.75e+75))) (+ (* a 120.0) (/ (* 60.0 x) (- 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 <= -960.0) || !(x <= 1.75e+75)) {
tmp = (a * 120.0) + ((60.0 * x) / (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 <= (-960.0d0)) .or. (.not. (x <= 1.75d+75))) then
tmp = (a * 120.0d0) + ((60.0d0 * x) / (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 <= -960.0) || !(x <= 1.75e+75)) {
tmp = (a * 120.0) + ((60.0 * x) / (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 <= -960.0) or not (x <= 1.75e+75): tmp = (a * 120.0) + ((60.0 * x) / (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 <= -960.0) || !(x <= 1.75e+75)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * x) / 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 <= -960.0) || ~((x <= 1.75e+75))) tmp = (a * 120.0) + ((60.0 * x) / (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, -960.0], N[Not[LessEqual[x, 1.75e+75]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * x), $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 -960 \lor \neg \left(x \leq 1.75 \cdot 10^{+75}\right):\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\end{array}
\end{array}
if x < -960 or 1.7499999999999999e75 < x Initial program 98.9%
Taylor expanded in x around inf 89.7%
associate-*r/88.8%
Simplified88.8%
if -960 < x < 1.7499999999999999e75Initial program 99.9%
Taylor expanded in x around 0 93.2%
associate-*r/93.2%
Simplified93.2%
Final simplification91.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(Float64(60.0 / 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[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{z - t} \cdot \left(x - y\right) + a \cdot 120
\end{array}
Initial program 99.4%
associate-*l/99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ x z))))
(if (<= x -2.2e+121)
t_1
(if (<= x 2.5e+159)
(* a 120.0)
(if (<= x 1.85e+282) t_1 (* x (/ -60.0 t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (x / z);
double tmp;
if (x <= -2.2e+121) {
tmp = t_1;
} else if (x <= 2.5e+159) {
tmp = a * 120.0;
} else if (x <= 1.85e+282) {
tmp = t_1;
} 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 = 60.0d0 * (x / z)
if (x <= (-2.2d+121)) then
tmp = t_1
else if (x <= 2.5d+159) then
tmp = a * 120.0d0
else if (x <= 1.85d+282) then
tmp = t_1
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 = 60.0 * (x / z);
double tmp;
if (x <= -2.2e+121) {
tmp = t_1;
} else if (x <= 2.5e+159) {
tmp = a * 120.0;
} else if (x <= 1.85e+282) {
tmp = t_1;
} else {
tmp = x * (-60.0 / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (x / z) tmp = 0 if x <= -2.2e+121: tmp = t_1 elif x <= 2.5e+159: tmp = a * 120.0 elif x <= 1.85e+282: tmp = t_1 else: tmp = x * (-60.0 / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(x / z)) tmp = 0.0 if (x <= -2.2e+121) tmp = t_1; elseif (x <= 2.5e+159) tmp = Float64(a * 120.0); elseif (x <= 1.85e+282) tmp = t_1; else tmp = Float64(x * Float64(-60.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * (x / z); tmp = 0.0; if (x <= -2.2e+121) tmp = t_1; elseif (x <= 2.5e+159) tmp = a * 120.0; elseif (x <= 1.85e+282) tmp = t_1; else tmp = x * (-60.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e+121], t$95$1, If[LessEqual[x, 2.5e+159], N[(a * 120.0), $MachinePrecision], If[LessEqual[x, 1.85e+282], t$95$1, N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z}\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+159}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+282}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if x < -2.20000000000000001e121 or 2.50000000000000002e159 < x < 1.8500000000000001e282Initial program 99.7%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 83.5%
associate-*r/83.4%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in z around inf 55.7%
if -2.20000000000000001e121 < x < 2.50000000000000002e159Initial program 99.8%
Taylor expanded in z around inf 52.6%
if 1.8500000000000001e282 < x Initial program 86.3%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 73.3%
associate-*r/59.6%
associate-*l/73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in z around 0 72.1%
Final simplification53.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.5e+47) (not (<= y 2.7e+200))) (* -60.0 (/ y z)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.5e+47) || !(y <= 2.7e+200)) {
tmp = -60.0 * (y / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-3.5d+47)) .or. (.not. (y <= 2.7d+200))) then
tmp = (-60.0d0) * (y / z)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.5e+47) || !(y <= 2.7e+200)) {
tmp = -60.0 * (y / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.5e+47) or not (y <= 2.7e+200): tmp = -60.0 * (y / z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.5e+47) || !(y <= 2.7e+200)) tmp = Float64(-60.0 * Float64(y / z)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.5e+47) || ~((y <= 2.7e+200))) tmp = -60.0 * (y / z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.5e+47], N[Not[LessEqual[y, 2.7e+200]], $MachinePrecision]], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+47} \lor \neg \left(y \leq 2.7 \cdot 10^{+200}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -3.50000000000000015e47 or 2.70000000000000016e200 < y Initial program 99.9%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 62.4%
Taylor expanded in z around inf 45.5%
if -3.50000000000000015e47 < y < 2.70000000000000016e200Initial program 99.3%
Taylor expanded in z around inf 52.8%
Final simplification50.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -1.8e+119) (not (<= x 5e+159))) (* 60.0 (/ x z)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.8e+119) || !(x <= 5e+159)) {
tmp = 60.0 * (x / 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 ((x <= (-1.8d+119)) .or. (.not. (x <= 5d+159))) then
tmp = 60.0d0 * (x / 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 ((x <= -1.8e+119) || !(x <= 5e+159)) {
tmp = 60.0 * (x / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -1.8e+119) or not (x <= 5e+159): tmp = 60.0 * (x / z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -1.8e+119) || !(x <= 5e+159)) tmp = Float64(60.0 * Float64(x / z)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -1.8e+119) || ~((x <= 5e+159))) tmp = 60.0 * (x / z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.8e+119], N[Not[LessEqual[x, 5e+159]], $MachinePrecision]], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+119} \lor \neg \left(x \leq 5 \cdot 10^{+159}\right):\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -1.80000000000000001e119 or 5.00000000000000003e159 < x Initial program 98.2%
associate-*l/99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 82.4%
associate-*r/80.7%
associate-*l/82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in z around inf 49.8%
if -1.80000000000000001e119 < x < 5.00000000000000003e159Initial program 99.8%
Taylor expanded in z around inf 52.6%
Final simplification51.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.4%
Taylor expanded in z around inf 43.7%
Final simplification43.7%
(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 2023311
(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)))