
(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 12 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) 60.0))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) / ((z - t) / 60.0)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) / Float64(Float64(z - t) / 60.0))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] / 60.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{x - y}{\frac{z - t}{60}}\right)
\end{array}
Initial program 99.4%
+-commutative99.4%
fma-def99.5%
*-commutative99.5%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -4e+127)
(* a 120.0)
(if (<= (* a 120.0) -4e+14)
(+ (* a 120.0) (* -60.0 (/ y z)))
(if (or (<= (* a 120.0) -2e-77) (not (<= (* a 120.0) 5e-52)))
(* a 120.0)
(* 60.0 (/ (- x y) (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -4e+127) {
tmp = a * 120.0;
} else if ((a * 120.0) <= -4e+14) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (((a * 120.0) <= -2e-77) || !((a * 120.0) <= 5e-52)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - 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 * 120.0d0) <= (-4d+127)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= (-4d+14)) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else if (((a * 120.0d0) <= (-2d-77)) .or. (.not. ((a * 120.0d0) <= 5d-52))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * ((x - 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 * 120.0) <= -4e+127) {
tmp = a * 120.0;
} else if ((a * 120.0) <= -4e+14) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (((a * 120.0) <= -2e-77) || !((a * 120.0) <= 5e-52)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -4e+127: tmp = a * 120.0 elif (a * 120.0) <= -4e+14: tmp = (a * 120.0) + (-60.0 * (y / z)) elif ((a * 120.0) <= -2e-77) or not ((a * 120.0) <= 5e-52): tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -4e+127) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= -4e+14) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); elseif ((Float64(a * 120.0) <= -2e-77) || !(Float64(a * 120.0) <= 5e-52)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -4e+127) tmp = a * 120.0; elseif ((a * 120.0) <= -4e+14) tmp = (a * 120.0) + (-60.0 * (y / z)); elseif (((a * 120.0) <= -2e-77) || ~(((a * 120.0) <= 5e-52))) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -4e+127], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], -4e+14], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -2e-77], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-52]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -4 \cdot 10^{+127}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq -4 \cdot 10^{+14}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-77} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-52}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a 120) < -3.99999999999999982e127 or -4e14 < (*.f64 a 120) < -1.9999999999999999e-77 or 5e-52 < (*.f64 a 120) Initial program 99.2%
Taylor expanded in z around inf 74.6%
if -3.99999999999999982e127 < (*.f64 a 120) < -4e14Initial program 99.8%
Taylor expanded in x around 0 81.3%
associate-*r/81.2%
Simplified81.2%
Taylor expanded in z around inf 72.1%
if -1.9999999999999999e-77 < (*.f64 a 120) < 5e-52Initial program 99.6%
associate-/l*99.6%
associate-/r/99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.6%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 80.2%
Final simplification76.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ (- x y) (- z t))))
(t_2 (+ (* a 120.0) (* 60.0 (/ y t))))
(t_3 (+ (* a 120.0) (* -60.0 (/ y z)))))
(if (<= t -2300.0)
t_2
(if (<= t 1.4e-305)
t_1
(if (<= t 2.95e-210)
t_3
(if (<= t 6.6e-88)
t_1
(if (<= t 2.5e+97) t_3 (if (<= t 1.1e+110) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double t_2 = (a * 120.0) + (60.0 * (y / t));
double t_3 = (a * 120.0) + (-60.0 * (y / z));
double tmp;
if (t <= -2300.0) {
tmp = t_2;
} else if (t <= 1.4e-305) {
tmp = t_1;
} else if (t <= 2.95e-210) {
tmp = t_3;
} else if (t <= 6.6e-88) {
tmp = t_1;
} else if (t <= 2.5e+97) {
tmp = t_3;
} else if (t <= 1.1e+110) {
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) :: t_3
real(8) :: tmp
t_1 = 60.0d0 * ((x - y) / (z - t))
t_2 = (a * 120.0d0) + (60.0d0 * (y / t))
t_3 = (a * 120.0d0) + ((-60.0d0) * (y / z))
if (t <= (-2300.0d0)) then
tmp = t_2
else if (t <= 1.4d-305) then
tmp = t_1
else if (t <= 2.95d-210) then
tmp = t_3
else if (t <= 6.6d-88) then
tmp = t_1
else if (t <= 2.5d+97) then
tmp = t_3
else if (t <= 1.1d+110) 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 * ((x - y) / (z - t));
double t_2 = (a * 120.0) + (60.0 * (y / t));
double t_3 = (a * 120.0) + (-60.0 * (y / z));
double tmp;
if (t <= -2300.0) {
tmp = t_2;
} else if (t <= 1.4e-305) {
tmp = t_1;
} else if (t <= 2.95e-210) {
tmp = t_3;
} else if (t <= 6.6e-88) {
tmp = t_1;
} else if (t <= 2.5e+97) {
tmp = t_3;
} else if (t <= 1.1e+110) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * ((x - y) / (z - t)) t_2 = (a * 120.0) + (60.0 * (y / t)) t_3 = (a * 120.0) + (-60.0 * (y / z)) tmp = 0 if t <= -2300.0: tmp = t_2 elif t <= 1.4e-305: tmp = t_1 elif t <= 2.95e-210: tmp = t_3 elif t <= 6.6e-88: tmp = t_1 elif t <= 2.5e+97: tmp = t_3 elif t <= 1.1e+110: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))) t_2 = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / t))) t_3 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))) tmp = 0.0 if (t <= -2300.0) tmp = t_2; elseif (t <= 1.4e-305) tmp = t_1; elseif (t <= 2.95e-210) tmp = t_3; elseif (t <= 6.6e-88) tmp = t_1; elseif (t <= 2.5e+97) tmp = t_3; elseif (t <= 1.1e+110) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * ((x - y) / (z - t)); t_2 = (a * 120.0) + (60.0 * (y / t)); t_3 = (a * 120.0) + (-60.0 * (y / z)); tmp = 0.0; if (t <= -2300.0) tmp = t_2; elseif (t <= 1.4e-305) tmp = t_1; elseif (t <= 2.95e-210) tmp = t_3; elseif (t <= 6.6e-88) tmp = t_1; elseif (t <= 2.5e+97) tmp = t_3; elseif (t <= 1.1e+110) 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[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2300.0], t$95$2, If[LessEqual[t, 1.4e-305], t$95$1, If[LessEqual[t, 2.95e-210], t$95$3, If[LessEqual[t, 6.6e-88], t$95$1, If[LessEqual[t, 2.5e+97], t$95$3, If[LessEqual[t, 1.1e+110], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z - t}\\
t_2 := a \cdot 120 + 60 \cdot \frac{y}{t}\\
t_3 := a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{if}\;t \leq -2300:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-305}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.95 \cdot 10^{-210}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+97}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+110}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2300 or 1.09999999999999996e110 < t Initial program 99.8%
Taylor expanded in z around 0 92.5%
Taylor expanded in x around 0 82.4%
if -2300 < t < 1.40000000000000007e-305 or 2.9499999999999999e-210 < t < 6.59999999999999987e-88 or 2.49999999999999999e97 < t < 1.09999999999999996e110Initial program 98.6%
associate-/l*99.6%
associate-/r/99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.6%
un-div-inv99.7%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 80.3%
if 1.40000000000000007e-305 < t < 2.9499999999999999e-210 or 6.59999999999999987e-88 < t < 2.49999999999999999e97Initial program 99.9%
Taylor expanded in x around 0 85.4%
associate-*r/85.3%
Simplified85.3%
Taylor expanded in z around inf 75.0%
Final simplification80.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ (- x y) (- z t))))
(t_2 (+ (* a 120.0) (/ -60.0 (/ t x)))))
(if (<= t -9.5e-30)
t_2
(if (<= t -3.2e-300)
t_1
(if (<= t 4.8e-210)
(+ (* a 120.0) (* -60.0 (/ y z)))
(if (<= t 6.4e-87) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double t_2 = (a * 120.0) + (-60.0 / (t / x));
double tmp;
if (t <= -9.5e-30) {
tmp = t_2;
} else if (t <= -3.2e-300) {
tmp = t_1;
} else if (t <= 4.8e-210) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (t <= 6.4e-87) {
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 * ((x - y) / (z - t))
t_2 = (a * 120.0d0) + ((-60.0d0) / (t / x))
if (t <= (-9.5d-30)) then
tmp = t_2
else if (t <= (-3.2d-300)) then
tmp = t_1
else if (t <= 4.8d-210) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else if (t <= 6.4d-87) 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 * ((x - y) / (z - t));
double t_2 = (a * 120.0) + (-60.0 / (t / x));
double tmp;
if (t <= -9.5e-30) {
tmp = t_2;
} else if (t <= -3.2e-300) {
tmp = t_1;
} else if (t <= 4.8e-210) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (t <= 6.4e-87) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * ((x - y) / (z - t)) t_2 = (a * 120.0) + (-60.0 / (t / x)) tmp = 0 if t <= -9.5e-30: tmp = t_2 elif t <= -3.2e-300: tmp = t_1 elif t <= 4.8e-210: tmp = (a * 120.0) + (-60.0 * (y / z)) elif t <= 6.4e-87: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))) t_2 = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(t / x))) tmp = 0.0 if (t <= -9.5e-30) tmp = t_2; elseif (t <= -3.2e-300) tmp = t_1; elseif (t <= 4.8e-210) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); elseif (t <= 6.4e-87) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * ((x - y) / (z - t)); t_2 = (a * 120.0) + (-60.0 / (t / x)); tmp = 0.0; if (t <= -9.5e-30) tmp = t_2; elseif (t <= -3.2e-300) tmp = t_1; elseif (t <= 4.8e-210) tmp = (a * 120.0) + (-60.0 * (y / z)); elseif (t <= 6.4e-87) 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[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e-30], t$95$2, If[LessEqual[t, -3.2e-300], t$95$1, If[LessEqual[t, 4.8e-210], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e-87], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z - t}\\
t_2 := a \cdot 120 + \frac{-60}{\frac{t}{x}}\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-30}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.2 \cdot 10^{-300}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-210}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-87}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -9.49999999999999939e-30 or 6.39999999999999958e-87 < t Initial program 99.3%
Taylor expanded in z around 0 87.5%
associate-*r/86.9%
associate-/l*87.4%
Simplified87.4%
Taylor expanded in x around inf 79.7%
if -9.49999999999999939e-30 < t < -3.20000000000000021e-300 or 4.80000000000000008e-210 < t < 6.39999999999999958e-87Initial program 99.7%
associate-/l*99.6%
associate-/r/99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.6%
un-div-inv99.7%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 83.7%
if -3.20000000000000021e-300 < t < 4.80000000000000008e-210Initial program 99.8%
Taylor expanded in x around 0 89.4%
associate-*r/89.2%
Simplified89.2%
Taylor expanded in z around inf 85.6%
Final simplification81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ (- x y) (- z t)))))
(if (<= t -9.6e-32)
(+ (* a 120.0) (/ (* x -60.0) t))
(if (<= t -2.9e-306)
t_1
(if (<= t 4.6e-210)
(+ (* a 120.0) (* -60.0 (/ y z)))
(if (<= t 1.36e-87) t_1 (+ (* a 120.0) (/ -60.0 (/ t x)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double tmp;
if (t <= -9.6e-32) {
tmp = (a * 120.0) + ((x * -60.0) / t);
} else if (t <= -2.9e-306) {
tmp = t_1;
} else if (t <= 4.6e-210) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (t <= 1.36e-87) {
tmp = t_1;
} else {
tmp = (a * 120.0) + (-60.0 / (t / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 60.0d0 * ((x - y) / (z - t))
if (t <= (-9.6d-32)) then
tmp = (a * 120.0d0) + ((x * (-60.0d0)) / t)
else if (t <= (-2.9d-306)) then
tmp = t_1
else if (t <= 4.6d-210) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else if (t <= 1.36d-87) then
tmp = t_1
else
tmp = (a * 120.0d0) + ((-60.0d0) / (t / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double tmp;
if (t <= -9.6e-32) {
tmp = (a * 120.0) + ((x * -60.0) / t);
} else if (t <= -2.9e-306) {
tmp = t_1;
} else if (t <= 4.6e-210) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (t <= 1.36e-87) {
tmp = t_1;
} else {
tmp = (a * 120.0) + (-60.0 / (t / x));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * ((x - y) / (z - t)) tmp = 0 if t <= -9.6e-32: tmp = (a * 120.0) + ((x * -60.0) / t) elif t <= -2.9e-306: tmp = t_1 elif t <= 4.6e-210: tmp = (a * 120.0) + (-60.0 * (y / z)) elif t <= 1.36e-87: tmp = t_1 else: tmp = (a * 120.0) + (-60.0 / (t / x)) return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))) tmp = 0.0 if (t <= -9.6e-32) tmp = Float64(Float64(a * 120.0) + Float64(Float64(x * -60.0) / t)); elseif (t <= -2.9e-306) tmp = t_1; elseif (t <= 4.6e-210) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); elseif (t <= 1.36e-87) tmp = t_1; else tmp = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(t / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * ((x - y) / (z - t)); tmp = 0.0; if (t <= -9.6e-32) tmp = (a * 120.0) + ((x * -60.0) / t); elseif (t <= -2.9e-306) tmp = t_1; elseif (t <= 4.6e-210) tmp = (a * 120.0) + (-60.0 * (y / z)); elseif (t <= 1.36e-87) tmp = t_1; else tmp = (a * 120.0) + (-60.0 / (t / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.6e-32], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x * -60.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.9e-306], t$95$1, If[LessEqual[t, 4.6e-210], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e-87], t$95$1, N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z - t}\\
\mathbf{if}\;t \leq -9.6 \cdot 10^{-32}:\\
\;\;\;\;a \cdot 120 + \frac{x \cdot -60}{t}\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-306}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-210}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 1.36 \cdot 10^{-87}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\
\end{array}
\end{array}
if t < -9.6000000000000005e-32Initial program 99.9%
Taylor expanded in x around inf 83.4%
associate-*r/83.4%
associate-/l*83.4%
Simplified83.4%
Taylor expanded in z around 0 76.7%
associate-*r/76.7%
Simplified76.7%
if -9.6000000000000005e-32 < t < -2.8999999999999999e-306 or 4.6e-210 < t < 1.3599999999999999e-87Initial program 99.7%
associate-/l*99.6%
associate-/r/99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.6%
un-div-inv99.7%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 83.7%
if -2.8999999999999999e-306 < t < 4.6e-210Initial program 99.8%
Taylor expanded in x around 0 89.4%
associate-*r/89.2%
Simplified89.2%
Taylor expanded in z around inf 85.6%
if 1.3599999999999999e-87 < t Initial program 98.9%
Taylor expanded in z around 0 87.5%
associate-*r/86.4%
associate-/l*87.4%
Simplified87.4%
Taylor expanded in x around inf 81.9%
Final simplification81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ (- x y) (- z t)))))
(if (<= x -2.9e+246)
t_1
(if (<= x 5.6e+167)
(+ (* a 120.0) (* -60.0 (/ y (- z t))))
(if (<= x 1.08e+223) (+ (* a 120.0) (/ -60.0 (/ t x))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double tmp;
if (x <= -2.9e+246) {
tmp = t_1;
} else if (x <= 5.6e+167) {
tmp = (a * 120.0) + (-60.0 * (y / (z - t)));
} else if (x <= 1.08e+223) {
tmp = (a * 120.0) + (-60.0 / (t / x));
} 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 * ((x - y) / (z - t))
if (x <= (-2.9d+246)) then
tmp = t_1
else if (x <= 5.6d+167) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / (z - t)))
else if (x <= 1.08d+223) then
tmp = (a * 120.0d0) + ((-60.0d0) / (t / x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double tmp;
if (x <= -2.9e+246) {
tmp = t_1;
} else if (x <= 5.6e+167) {
tmp = (a * 120.0) + (-60.0 * (y / (z - t)));
} else if (x <= 1.08e+223) {
tmp = (a * 120.0) + (-60.0 / (t / x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * ((x - y) / (z - t)) tmp = 0 if x <= -2.9e+246: tmp = t_1 elif x <= 5.6e+167: tmp = (a * 120.0) + (-60.0 * (y / (z - t))) elif x <= 1.08e+223: tmp = (a * 120.0) + (-60.0 / (t / x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))) tmp = 0.0 if (x <= -2.9e+246) tmp = t_1; elseif (x <= 5.6e+167) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / Float64(z - t)))); elseif (x <= 1.08e+223) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 / Float64(t / x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * ((x - y) / (z - t)); tmp = 0.0; if (x <= -2.9e+246) tmp = t_1; elseif (x <= 5.6e+167) tmp = (a * 120.0) + (-60.0 * (y / (z - t))); elseif (x <= 1.08e+223) tmp = (a * 120.0) + (-60.0 / (t / x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+246], t$95$1, If[LessEqual[x, 5.6e+167], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.08e+223], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z - t}\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+246}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+167}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{+223}:\\
\;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.90000000000000014e246 or 1.08000000000000005e223 < x Initial program 95.6%
associate-/l*99.6%
associate-/r/99.6%
Applied egg-rr99.6%
*-commutative99.6%
clear-num99.5%
un-div-inv99.7%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 95.4%
if -2.90000000000000014e246 < x < 5.5999999999999998e167Initial program 99.8%
Taylor expanded in x around 0 85.2%
if 5.5999999999999998e167 < x < 1.08000000000000005e223Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -5.2e+139) (not (<= x 1.25e+166))) (+ (* a 120.0) (* -60.0 (/ (- x y) t))) (+ (* a 120.0) (* -60.0 (/ y (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5.2e+139) || !(x <= 1.25e+166)) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (-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 ((x <= (-5.2d+139)) .or. (.not. (x <= 1.25d+166))) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else
tmp = (a * 120.0d0) + ((-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 ((x <= -5.2e+139) || !(x <= 1.25e+166)) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else {
tmp = (a * 120.0) + (-60.0 * (y / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -5.2e+139) or not (x <= 1.25e+166): tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) else: tmp = (a * 120.0) + (-60.0 * (y / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -5.2e+139) || !(x <= 1.25e+166)) 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(y / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -5.2e+139) || ~((x <= 1.25e+166))) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); else tmp = (a * 120.0) + (-60.0 * (y / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -5.2e+139], N[Not[LessEqual[x, 1.25e+166]], $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[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+139} \lor \neg \left(x \leq 1.25 \cdot 10^{+166}\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\
\end{array}
\end{array}
if x < -5.20000000000000044e139 or 1.25e166 < x Initial program 98.2%
Taylor expanded in z around 0 74.6%
if -5.20000000000000044e139 < x < 1.25e166Initial program 99.8%
Taylor expanded in x around 0 88.6%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.75e-38) (not (<= y 5.4e+97))) (+ (* a 120.0) (* -60.0 (/ y (- z t)))) (+ (* a 120.0) (/ 60.0 (/ (- z t) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.75e-38) || !(y <= 5.4e+97)) {
tmp = (a * 120.0) + (-60.0 * (y / (z - t)));
} else {
tmp = (a * 120.0) + (60.0 / ((z - t) / x));
}
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 <= (-1.75d-38)) .or. (.not. (y <= 5.4d+97))) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / (z - t)))
else
tmp = (a * 120.0d0) + (60.0d0 / ((z - t) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.75e-38) || !(y <= 5.4e+97)) {
tmp = (a * 120.0) + (-60.0 * (y / (z - t)));
} else {
tmp = (a * 120.0) + (60.0 / ((z - t) / x));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.75e-38) or not (y <= 5.4e+97): tmp = (a * 120.0) + (-60.0 * (y / (z - t))) else: tmp = (a * 120.0) + (60.0 / ((z - t) / x)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.75e-38) || !(y <= 5.4e+97)) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / Float64(z - t)))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(Float64(z - t) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.75e-38) || ~((y <= 5.4e+97))) tmp = (a * 120.0) + (-60.0 * (y / (z - t))); else tmp = (a * 120.0) + (60.0 / ((z - t) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.75e-38], N[Not[LessEqual[y, 5.4e+97]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-38} \lor \neg \left(y \leq 5.4 \cdot 10^{+97}\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{z - t}{x}}\\
\end{array}
\end{array}
if y < -1.7500000000000001e-38 or 5.39999999999999987e97 < y Initial program 99.0%
Taylor expanded in x around 0 89.9%
if -1.7500000000000001e-38 < y < 5.39999999999999987e97Initial program 99.9%
Taylor expanded in x around inf 94.9%
associate-*r/94.9%
associate-/l*94.9%
Simplified94.9%
Final simplification92.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e-79) (not (<= a 7.2e-53))) (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e-79) || !(a <= 7.2e-53)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - 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 <= (-2d-79)) .or. (.not. (a <= 7.2d-53))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * ((x - 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 <= -2e-79) || !(a <= 7.2e-53)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e-79) or not (a <= 7.2e-53): tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e-79) || !(a <= 7.2e-53)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2e-79) || ~((a <= 7.2e-53))) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e-79], N[Not[LessEqual[a, 7.2e-53]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-79} \lor \neg \left(a \leq 7.2 \cdot 10^{-53}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if a < -2e-79 or 7.1999999999999998e-53 < a Initial program 99.3%
Taylor expanded in z around inf 71.0%
if -2e-79 < a < 7.1999999999999998e-53Initial program 99.6%
associate-/l*99.6%
associate-/r/99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.6%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 80.2%
Final simplification74.4%
(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.4%
associate-/l*99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -7e+246) (not (<= x 1.1e+224))) (* -60.0 (/ x t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -7e+246) || !(x <= 1.1e+224)) {
tmp = -60.0 * (x / 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 ((x <= (-7d+246)) .or. (.not. (x <= 1.1d+224))) then
tmp = (-60.0d0) * (x / 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 ((x <= -7e+246) || !(x <= 1.1e+224)) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -7e+246) or not (x <= 1.1e+224): tmp = -60.0 * (x / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -7e+246) || !(x <= 1.1e+224)) tmp = Float64(-60.0 * Float64(x / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -7e+246) || ~((x <= 1.1e+224))) tmp = -60.0 * (x / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -7e+246], N[Not[LessEqual[x, 1.1e+224]], $MachinePrecision]], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+246} \lor \neg \left(x \leq 1.1 \cdot 10^{+224}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -6.99999999999999951e246 or 1.1e224 < x Initial program 95.6%
Taylor expanded in z around 0 73.4%
Taylor expanded in x around inf 66.8%
if -6.99999999999999951e246 < x < 1.1e224Initial program 99.8%
Taylor expanded in z around inf 56.7%
Final simplification57.6%
(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 52.5%
Final simplification52.5%
(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 2023310
(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)))