
(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) (/ (- 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.5%
+-commutative99.5%
fma-def99.5%
*-commutative99.5%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (<= t_1 -2e+79)
(* 60.0 (/ (- x y) (- z t)))
(if (<= t_1 -2e-96)
(+ (* a 120.0) (* -60.0 (/ y z)))
(if (<= t_1 0.2) (* a 120.0) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+79) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= -2e-96) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (t_1 <= 0.2) {
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 = ((x - y) * 60.0d0) / (z - t)
if (t_1 <= (-2d+79)) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if (t_1 <= (-2d-96)) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else if (t_1 <= 0.2d0) then
tmp = a * 120.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if (t_1 <= -2e+79) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= -2e-96) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (t_1 <= 0.2) {
tmp = a * 120.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if t_1 <= -2e+79: tmp = 60.0 * ((x - y) / (z - t)) elif t_1 <= -2e-96: tmp = (a * 120.0) + (-60.0 * (y / z)) elif t_1 <= 0.2: tmp = a * 120.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+79) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (t_1 <= -2e-96) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); elseif (t_1 <= 0.2) tmp = Float64(a * 120.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if (t_1 <= -2e+79) tmp = 60.0 * ((x - y) / (z - t)); elseif (t_1 <= -2e-96) tmp = (a * 120.0) + (-60.0 * (y / z)); elseif (t_1 <= 0.2) tmp = a * 120.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+79], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-96], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.2], N[(a * 120.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+79}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-96}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{elif}\;t_1 \leq 0.2:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -1.99999999999999993e79Initial program 97.9%
*-commutative97.9%
associate-/l*99.6%
div-inv99.6%
*-un-lft-identity99.6%
times-frac97.7%
metadata-eval97.7%
Applied egg-rr97.7%
Taylor expanded in a around 0 80.1%
if -1.99999999999999993e79 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -1.9999999999999998e-96Initial program 99.7%
Taylor expanded in z around inf 71.3%
Taylor expanded in x around 0 72.0%
if -1.9999999999999998e-96 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 0.20000000000000001Initial program 99.9%
Taylor expanded in z around inf 85.4%
if 0.20000000000000001 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) Initial program 99.9%
*-commutative99.9%
associate-/l*99.8%
div-inv99.8%
*-un-lft-identity99.8%
times-frac99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 76.1%
expm1-log1p-u71.2%
expm1-udef71.2%
Applied egg-rr71.2%
expm1-def71.2%
expm1-log1p76.1%
associate-*r/76.2%
Simplified76.2%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* -60.0 (/ y z)))))
(if (<= z -2.1e+194)
t_1
(if (<= z -6e+73)
(+ (* a 120.0) (/ x (* z 0.016666666666666666)))
(if (or (<= z -0.000175) (not (<= z 3.6e-72)))
t_1
(+ (* a 120.0) (* -60.0 (/ (- x y) t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (-60.0 * (y / z));
double tmp;
if (z <= -2.1e+194) {
tmp = t_1;
} else if (z <= -6e+73) {
tmp = (a * 120.0) + (x / (z * 0.016666666666666666));
} else if ((z <= -0.000175) || !(z <= 3.6e-72)) {
tmp = t_1;
} else {
tmp = (a * 120.0) + (-60.0 * ((x - y) / 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 = (a * 120.0d0) + ((-60.0d0) * (y / z))
if (z <= (-2.1d+194)) then
tmp = t_1
else if (z <= (-6d+73)) then
tmp = (a * 120.0d0) + (x / (z * 0.016666666666666666d0))
else if ((z <= (-0.000175d0)) .or. (.not. (z <= 3.6d-72))) then
tmp = t_1
else
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
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 * (y / z));
double tmp;
if (z <= -2.1e+194) {
tmp = t_1;
} else if (z <= -6e+73) {
tmp = (a * 120.0) + (x / (z * 0.016666666666666666));
} else if ((z <= -0.000175) || !(z <= 3.6e-72)) {
tmp = t_1;
} else {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (-60.0 * (y / z)) tmp = 0 if z <= -2.1e+194: tmp = t_1 elif z <= -6e+73: tmp = (a * 120.0) + (x / (z * 0.016666666666666666)) elif (z <= -0.000175) or not (z <= 3.6e-72): tmp = t_1 else: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))) tmp = 0.0 if (z <= -2.1e+194) tmp = t_1; elseif (z <= -6e+73) tmp = Float64(Float64(a * 120.0) + Float64(x / Float64(z * 0.016666666666666666))); elseif ((z <= -0.000175) || !(z <= 3.6e-72)) tmp = t_1; else tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * 120.0) + (-60.0 * (y / z)); tmp = 0.0; if (z <= -2.1e+194) tmp = t_1; elseif (z <= -6e+73) tmp = (a * 120.0) + (x / (z * 0.016666666666666666)); elseif ((z <= -0.000175) || ~((z <= 3.6e-72))) tmp = t_1; else tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); 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[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+194], t$95$1, If[LessEqual[z, -6e+73], N[(N[(a * 120.0), $MachinePrecision] + N[(x / N[(z * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -0.000175], N[Not[LessEqual[z, 3.6e-72]], $MachinePrecision]], t$95$1, N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{+73}:\\
\;\;\;\;a \cdot 120 + \frac{x}{z \cdot 0.016666666666666666}\\
\mathbf{elif}\;z \leq -0.000175 \lor \neg \left(z \leq 3.6 \cdot 10^{-72}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if z < -2.10000000000000016e194 or -6.00000000000000021e73 < z < -1.74999999999999998e-4 or 3.6e-72 < z Initial program 99.8%
Taylor expanded in z around inf 87.8%
Taylor expanded in x around 0 80.2%
if -2.10000000000000016e194 < z < -6.00000000000000021e73Initial program 100.0%
Taylor expanded in z around inf 88.5%
Taylor expanded in x around inf 87.3%
associate-*r/87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in x around 0 87.3%
*-commutative87.3%
metadata-eval87.3%
times-frac87.4%
*-rgt-identity87.4%
Simplified87.4%
if -1.74999999999999998e-4 < z < 3.6e-72Initial program 99.0%
Taylor expanded in z around 0 89.2%
Final simplification85.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* -60.0 (/ y z)))))
(if (<= z -4.2e+193)
t_1
(if (<= z -2.9e+73)
(+ (* a 120.0) (/ x (* z 0.016666666666666666)))
(if (or (<= z -6.6e-8) (not (<= z 1.85e-72)))
t_1
(+ (* a 120.0) (/ -60.0 (/ t x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * 120.0) + (-60.0 * (y / z));
double tmp;
if (z <= -4.2e+193) {
tmp = t_1;
} else if (z <= -2.9e+73) {
tmp = (a * 120.0) + (x / (z * 0.016666666666666666));
} else if ((z <= -6.6e-8) || !(z <= 1.85e-72)) {
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 = (a * 120.0d0) + ((-60.0d0) * (y / z))
if (z <= (-4.2d+193)) then
tmp = t_1
else if (z <= (-2.9d+73)) then
tmp = (a * 120.0d0) + (x / (z * 0.016666666666666666d0))
else if ((z <= (-6.6d-8)) .or. (.not. (z <= 1.85d-72))) 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 = (a * 120.0) + (-60.0 * (y / z));
double tmp;
if (z <= -4.2e+193) {
tmp = t_1;
} else if (z <= -2.9e+73) {
tmp = (a * 120.0) + (x / (z * 0.016666666666666666));
} else if ((z <= -6.6e-8) || !(z <= 1.85e-72)) {
tmp = t_1;
} else {
tmp = (a * 120.0) + (-60.0 / (t / x));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * 120.0) + (-60.0 * (y / z)) tmp = 0 if z <= -4.2e+193: tmp = t_1 elif z <= -2.9e+73: tmp = (a * 120.0) + (x / (z * 0.016666666666666666)) elif (z <= -6.6e-8) or not (z <= 1.85e-72): tmp = t_1 else: tmp = (a * 120.0) + (-60.0 / (t / x)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))) tmp = 0.0 if (z <= -4.2e+193) tmp = t_1; elseif (z <= -2.9e+73) tmp = Float64(Float64(a * 120.0) + Float64(x / Float64(z * 0.016666666666666666))); elseif ((z <= -6.6e-8) || !(z <= 1.85e-72)) 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 = (a * 120.0) + (-60.0 * (y / z)); tmp = 0.0; if (z <= -4.2e+193) tmp = t_1; elseif (z <= -2.9e+73) tmp = (a * 120.0) + (x / (z * 0.016666666666666666)); elseif ((z <= -6.6e-8) || ~((z <= 1.85e-72))) 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[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+193], t$95$1, If[LessEqual[z, -2.9e+73], N[(N[(a * 120.0), $MachinePrecision] + N[(x / N[(z * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -6.6e-8], N[Not[LessEqual[z, 1.85e-72]], $MachinePrecision]], 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 := a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+193}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+73}:\\
\;\;\;\;a \cdot 120 + \frac{x}{z \cdot 0.016666666666666666}\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-8} \lor \neg \left(z \leq 1.85 \cdot 10^{-72}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\
\end{array}
\end{array}
if z < -4.2e193 or -2.9000000000000002e73 < z < -6.59999999999999954e-8 or 1.8499999999999999e-72 < z Initial program 99.8%
Taylor expanded in z around inf 87.8%
Taylor expanded in x around 0 80.2%
if -4.2e193 < z < -2.9000000000000002e73Initial program 100.0%
Taylor expanded in z around inf 88.5%
Taylor expanded in x around inf 87.3%
associate-*r/87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in x around 0 87.3%
*-commutative87.3%
metadata-eval87.3%
times-frac87.4%
*-rgt-identity87.4%
Simplified87.4%
if -6.59999999999999954e-8 < z < 1.8499999999999999e-72Initial program 99.0%
Taylor expanded in z around 0 89.2%
associate-*r/88.3%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in x around inf 73.9%
Final simplification78.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (* a 120.0) (* 60.0 (/ (- x y) z)))))
(if (<= z -2.4e-8)
t_1
(if (<= z 2.9e-85)
(+ (* a 120.0) (* -60.0 (/ (- x y) t)))
(if (<= z 2.85e+62) (+ (* a 120.0) (/ (* y -60.0) (- z 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-8) {
tmp = t_1;
} else if (z <= 2.9e-85) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (z <= 2.85e+62) {
tmp = (a * 120.0) + ((y * -60.0) / (z - 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-8)) then
tmp = t_1
else if (z <= 2.9d-85) then
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
else if (z <= 2.85d+62) then
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - 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-8) {
tmp = t_1;
} else if (z <= 2.9e-85) {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
} else if (z <= 2.85e+62) {
tmp = (a * 120.0) + ((y * -60.0) / (z - 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-8: tmp = t_1 elif z <= 2.9e-85: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) elif z <= 2.85e+62: tmp = (a * 120.0) + ((y * -60.0) / (z - 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-8) tmp = t_1; elseif (z <= 2.9e-85) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); elseif (z <= 2.85e+62) tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - 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-8) tmp = t_1; elseif (z <= 2.9e-85) tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); elseif (z <= 2.85e+62) tmp = (a * 120.0) + ((y * -60.0) / (z - 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-8], t$95$1, If[LessEqual[z, 2.9e-85], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e+62], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - 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^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-85}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+62}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.39999999999999998e-8 or 2.84999999999999999e62 < z Initial program 99.9%
Taylor expanded in z around inf 92.3%
if -2.39999999999999998e-8 < z < 2.9000000000000002e-85Initial program 98.9%
Taylor expanded in z around 0 89.1%
if 2.9000000000000002e-85 < z < 2.84999999999999999e62Initial program 99.9%
Taylor expanded in x around 0 89.2%
associate-*r/89.2%
Simplified89.2%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -1e-7) (not (<= (* a 120.0) 4e+18))) (* 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) <= -1e-7) || !((a * 120.0) <= 4e+18)) {
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) <= (-1d-7)) .or. (.not. ((a * 120.0d0) <= 4d+18))) 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) <= -1e-7) || !((a * 120.0) <= 4e+18)) {
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) <= -1e-7) or not ((a * 120.0) <= 4e+18): 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) <= -1e-7) || !(Float64(a * 120.0) <= 4e+18)) 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) <= -1e-7) || ~(((a * 120.0) <= 4e+18))) 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[N[(a * 120.0), $MachinePrecision], -1e-7], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 4e+18]], $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 -1 \cdot 10^{-7} \lor \neg \left(a \cdot 120 \leq 4 \cdot 10^{+18}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a 120) < -9.9999999999999995e-8 or 4e18 < (*.f64 a 120) Initial program 99.9%
Taylor expanded in z around inf 78.2%
if -9.9999999999999995e-8 < (*.f64 a 120) < 4e18Initial program 99.0%
*-commutative99.0%
associate-/l*99.7%
div-inv99.6%
*-un-lft-identity99.6%
times-frac98.8%
metadata-eval98.8%
Applied egg-rr98.8%
Taylor expanded in a around 0 70.5%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e-7) (not (<= z 1.9e-64))) (+ (* a 120.0) (* 60.0 (/ (- x y) z))) (+ (* a 120.0) (* -60.0 (/ (- x y) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-7) || !(z <= 1.9e-64)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + (-60.0 * ((x - y) / 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 ((z <= (-4.8d-7)) .or. (.not. (z <= 1.9d-64))) then
tmp = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
else
tmp = (a * 120.0d0) + ((-60.0d0) * ((x - y) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e-7) || !(z <= 1.9e-64)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + (-60.0 * ((x - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e-7) or not (z <= 1.9e-64): tmp = (a * 120.0) + (60.0 * ((x - y) / z)) else: tmp = (a * 120.0) + (-60.0 * ((x - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e-7) || !(z <= 1.9e-64)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))); else tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(Float64(x - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e-7) || ~((z <= 1.9e-64))) tmp = (a * 120.0) + (60.0 * ((x - y) / z)); else tmp = (a * 120.0) + (-60.0 * ((x - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e-7], N[Not[LessEqual[z, 1.9e-64]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-7} \lor \neg \left(z \leq 1.9 \cdot 10^{-64}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if z < -4.79999999999999957e-7 or 1.9000000000000001e-64 < z Initial program 99.9%
Taylor expanded in z around inf 88.5%
if -4.79999999999999957e-7 < z < 1.9000000000000001e-64Initial program 99.0%
Taylor expanded in z around 0 89.4%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -440.0) (not (<= x 3350000.0))) (+ (* 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 <= -440.0) || !(x <= 3350000.0)) {
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 <= (-440.0d0)) .or. (.not. (x <= 3350000.0d0))) 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 <= -440.0) || !(x <= 3350000.0)) {
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 <= -440.0) or not (x <= 3350000.0): 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 <= -440.0) || !(x <= 3350000.0)) 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 <= -440.0) || ~((x <= 3350000.0))) 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, -440.0], N[Not[LessEqual[x, 3350000.0]], $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 -440 \lor \neg \left(x \leq 3350000\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 < -440 or 3.35e6 < x Initial program 99.0%
Taylor expanded in x around inf 87.1%
associate-*r/86.4%
Simplified86.4%
if -440 < x < 3.35e6Initial program 99.9%
Taylor expanded in x around 0 98.0%
associate-*r/98.0%
Simplified98.0%
Final simplification92.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e-7) (not (<= z 3.6e-72))) (+ (* a 120.0) (* -60.0 (/ y z))) (+ (* a 120.0) (/ -60.0 (/ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-7) || !(z <= 3.6e-72)) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} 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) :: tmp
if ((z <= (-1.2d-7)) .or. (.not. (z <= 3.6d-72))) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
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 tmp;
if ((z <= -1.2e-7) || !(z <= 3.6e-72)) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else {
tmp = (a * 120.0) + (-60.0 / (t / x));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e-7) or not (z <= 3.6e-72): tmp = (a * 120.0) + (-60.0 * (y / z)) else: tmp = (a * 120.0) + (-60.0 / (t / x)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e-7) || !(z <= 3.6e-72)) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); 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) tmp = 0.0; if ((z <= -1.2e-7) || ~((z <= 3.6e-72))) tmp = (a * 120.0) + (-60.0 * (y / z)); else tmp = (a * 120.0) + (-60.0 / (t / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e-7], N[Not[LessEqual[z, 3.6e-72]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-7} \lor \neg \left(z \leq 3.6 \cdot 10^{-72}\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{-60}{\frac{t}{x}}\\
\end{array}
\end{array}
if z < -1.19999999999999989e-7 or 3.6e-72 < z Initial program 99.9%
Taylor expanded in z around inf 87.9%
Taylor expanded in x around 0 77.5%
if -1.19999999999999989e-7 < z < 3.6e-72Initial program 99.0%
Taylor expanded in z around 0 89.2%
associate-*r/88.3%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in x around inf 73.9%
Final simplification75.9%
(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(Float64(x - y) * 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[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x - y\right) \cdot 60}{z - t} + a \cdot 120
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.3e+256) (not (<= x 1.75e+102))) (* -60.0 (/ (- x y) t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.3e+256) || !(x <= 1.75e+102)) {
tmp = -60.0 * ((x - y) / 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 <= (-2.3d+256)) .or. (.not. (x <= 1.75d+102))) then
tmp = (-60.0d0) * ((x - y) / 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 <= -2.3e+256) || !(x <= 1.75e+102)) {
tmp = -60.0 * ((x - y) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -2.3e+256) or not (x <= 1.75e+102): tmp = -60.0 * ((x - y) / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.3e+256) || !(x <= 1.75e+102)) tmp = Float64(-60.0 * Float64(Float64(x - y) / 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 <= -2.3e+256) || ~((x <= 1.75e+102))) tmp = -60.0 * ((x - y) / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.3e+256], N[Not[LessEqual[x, 1.75e+102]], $MachinePrecision]], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+256} \lor \neg \left(x \leq 1.75 \cdot 10^{+102}\right):\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -2.2999999999999999e256 or 1.75000000000000005e102 < x Initial program 97.8%
*-commutative97.8%
associate-/l*99.7%
div-inv99.6%
*-un-lft-identity99.6%
times-frac97.7%
metadata-eval97.7%
Applied egg-rr97.7%
Taylor expanded in a around 0 75.7%
Taylor expanded in z around 0 51.0%
if -2.2999999999999999e256 < x < 1.75000000000000005e102Initial program 99.9%
Taylor expanded in z around inf 62.7%
Final simplification60.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -3.6e+242) (not (<= x 3.6e+139))) (* 60.0 (/ x (- z t))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -3.6e+242) || !(x <= 3.6e+139)) {
tmp = 60.0 * (x / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-3.6d+242)) .or. (.not. (x <= 3.6d+139))) then
tmp = 60.0d0 * (x / (z - t))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -3.6e+242) || !(x <= 3.6e+139)) {
tmp = 60.0 * (x / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -3.6e+242) or not (x <= 3.6e+139): tmp = 60.0 * (x / (z - t)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -3.6e+242) || !(x <= 3.6e+139)) tmp = Float64(60.0 * Float64(x / Float64(z - t))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -3.6e+242) || ~((x <= 3.6e+139))) tmp = 60.0 * (x / (z - t)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -3.6e+242], N[Not[LessEqual[x, 3.6e+139]], $MachinePrecision]], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+242} \lor \neg \left(x \leq 3.6 \cdot 10^{+139}\right):\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -3.59999999999999995e242 or 3.59999999999999985e139 < x Initial program 97.6%
*-commutative97.6%
associate-/l*99.7%
div-inv99.6%
*-un-lft-identity99.6%
times-frac97.4%
metadata-eval97.4%
Applied egg-rr97.4%
Taylor expanded in a around 0 79.4%
Taylor expanded in x around inf 72.7%
if -3.59999999999999995e242 < x < 3.59999999999999985e139Initial program 99.9%
Taylor expanded in z around inf 62.3%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.6e+129) (* -60.0 (/ y z)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.6e+129) {
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 <= (-2.6d+129)) 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 <= -2.6e+129) {
tmp = -60.0 * (y / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.6e+129: tmp = -60.0 * (y / z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.6e+129) 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 <= -2.6e+129) tmp = -60.0 * (y / z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.6e+129], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+129}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -2.60000000000000012e129Initial program 99.7%
*-commutative99.7%
associate-/l*99.6%
div-inv99.6%
*-un-lft-identity99.6%
times-frac99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 73.5%
Taylor expanded in x around 0 55.5%
associate-*r/55.6%
associate-/l*55.5%
Simplified55.5%
Taylor expanded in z around inf 43.6%
if -2.60000000000000012e129 < y Initial program 99.4%
Taylor expanded in z around inf 60.3%
Final simplification57.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.6e+129) (/ y (/ z -60.0)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.6e+129) {
tmp = y / (z / -60.0);
} 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 <= (-2.6d+129)) then
tmp = y / (z / (-60.0d0))
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 <= -2.6e+129) {
tmp = y / (z / -60.0);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.6e+129: tmp = y / (z / -60.0) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.6e+129) tmp = Float64(y / Float64(z / -60.0)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.6e+129) tmp = y / (z / -60.0); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.6e+129], N[(y / N[(z / -60.0), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+129}:\\
\;\;\;\;\frac{y}{\frac{z}{-60}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -2.60000000000000012e129Initial program 99.7%
*-commutative99.7%
associate-/l*99.6%
div-inv99.6%
*-un-lft-identity99.6%
times-frac99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in a around 0 73.5%
Taylor expanded in x around 0 55.5%
associate-*r/55.6%
associate-/l*55.5%
Simplified55.5%
Taylor expanded in z around inf 43.6%
associate-*r/43.6%
*-commutative43.6%
associate-/l*43.6%
Simplified43.6%
if -2.60000000000000012e129 < y Initial program 99.4%
Taylor expanded in z around inf 60.3%
Final simplification57.7%
(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.5%
Taylor expanded in z around inf 54.6%
Final simplification54.6%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
herbie shell --seed 2023309
(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)))