
(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 8 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 (+ (* (- 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 98.6%
*-commutative98.6%
associate-/l*99.8%
Applied egg-rr99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -1e-64) (not (<= (* a 120.0) 5e-120))) (+ (* a 120.0) (* 60.0 (/ x (- z t)))) (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -1e-64) || !((a * 120.0) <= 5e-120)) {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a * 120.0d0) <= (-1d-64)) .or. (.not. ((a * 120.0d0) <= 5d-120))) then
tmp = (a * 120.0d0) + (60.0d0 * (x / (z - t)))
else
tmp = (x - y) * (60.0d0 / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -1e-64) || !((a * 120.0) <= 5e-120)) {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -1e-64) or not ((a * 120.0) <= 5e-120): tmp = (a * 120.0) + (60.0 * (x / (z - t))) else: tmp = (x - y) * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -1e-64) || !(Float64(a * 120.0) <= 5e-120)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); else tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -1e-64) || ~(((a * 120.0) <= 5e-120))) tmp = (a * 120.0) + (60.0 * (x / (z - t))); else tmp = (x - y) * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -1e-64], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-120]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{-64} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-120}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.99999999999999965e-65 or 5.00000000000000007e-120 < (*.f64 a #s(literal 120 binary64)) Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 87.6%
if -9.99999999999999965e-65 < (*.f64 a #s(literal 120 binary64)) < 5.00000000000000007e-120Initial program 97.8%
associate-/l*99.6%
Simplified99.6%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 79.7%
associate-*r/77.9%
associate-*l/79.8%
metadata-eval79.8%
associate-*r/79.7%
*-commutative79.7%
associate-*r/79.8%
metadata-eval79.8%
Simplified79.8%
Final simplification84.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -6e+21) (not (<= (* a 120.0) 1.5e-11))) (* a 120.0) (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -6e+21) || !((a * 120.0) <= 1.5e-11)) {
tmp = a * 120.0;
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a * 120.0d0) <= (-6d+21)) .or. (.not. ((a * 120.0d0) <= 1.5d-11))) then
tmp = a * 120.0d0
else
tmp = (x - y) * (60.0d0 / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -6e+21) || !((a * 120.0) <= 1.5e-11)) {
tmp = a * 120.0;
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -6e+21) or not ((a * 120.0) <= 1.5e-11): tmp = a * 120.0 else: tmp = (x - y) * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -6e+21) || !(Float64(a * 120.0) <= 1.5e-11)) tmp = Float64(a * 120.0); else tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -6e+21) || ~(((a * 120.0) <= 1.5e-11))) tmp = a * 120.0; else tmp = (x - y) * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -6e+21], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1.5e-11]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -6 \cdot 10^{+21} \lor \neg \left(a \cdot 120 \leq 1.5 \cdot 10^{-11}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -6e21 or 1.5e-11 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 82.1%
if -6e21 < (*.f64 a #s(literal 120 binary64)) < 1.5e-11Initial program 97.8%
associate-/l*99.7%
Simplified99.7%
clear-num99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 72.6%
associate-*r/70.7%
associate-*l/72.7%
metadata-eval72.7%
associate-*r/72.5%
*-commutative72.5%
associate-*r/72.7%
metadata-eval72.7%
Simplified72.7%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -7.5e+54) (not (<= x 4.6e+20))) (+ (* 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 <= -7.5e+54) || !(x <= 4.6e+20)) {
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 <= (-7.5d+54)) .or. (.not. (x <= 4.6d+20))) 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 <= -7.5e+54) || !(x <= 4.6e+20)) {
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 <= -7.5e+54) or not (x <= 4.6e+20): 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 <= -7.5e+54) || !(x <= 4.6e+20)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); else tmp = Float64(Float64(a * 120.0) + Float64(y * Float64(-60.0 / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -7.5e+54) || ~((x <= 4.6e+20))) 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, -7.5e+54], N[Not[LessEqual[x, 4.6e+20]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+54} \lor \neg \left(x \leq 4.6 \cdot 10^{+20}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{-60}{z - t}\\
\end{array}
\end{array}
if x < -7.50000000000000042e54 or 4.6e20 < x Initial program 97.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 91.9%
if -7.50000000000000042e54 < x < 4.6e20Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 92.1%
associate-*r/92.1%
Simplified92.1%
*-commutative92.1%
associate-/l*92.1%
Applied egg-rr92.1%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -8.5e+54) (not (<= x 1.4e+21))) (+ (* a 120.0) (* 60.0 (/ x (- z t)))) (+ (* a 120.0) (* 60.0 (/ y (- t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -8.5e+54) || !(x <= 1.4e+21)) {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
} else {
tmp = (a * 120.0) + (60.0 * (y / (t - 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 ((x <= (-8.5d+54)) .or. (.not. (x <= 1.4d+21))) then
tmp = (a * 120.0d0) + (60.0d0 * (x / (z - t)))
else
tmp = (a * 120.0d0) + (60.0d0 * (y / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -8.5e+54) || !(x <= 1.4e+21)) {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
} else {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -8.5e+54) or not (x <= 1.4e+21): tmp = (a * 120.0) + (60.0 * (x / (z - t))) else: tmp = (a * 120.0) + (60.0 * (y / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -8.5e+54) || !(x <= 1.4e+21)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -8.5e+54) || ~((x <= 1.4e+21))) tmp = (a * 120.0) + (60.0 * (x / (z - t))); else tmp = (a * 120.0) + (60.0 * (y / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -8.5e+54], N[Not[LessEqual[x, 1.4e+21]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+54} \lor \neg \left(x \leq 1.4 \cdot 10^{+21}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if x < -8.4999999999999995e54 or 1.4e21 < x Initial program 97.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 91.9%
if -8.4999999999999995e54 < x < 1.4e21Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 92.1%
neg-mul-192.1%
distribute-neg-frac292.1%
neg-sub092.1%
sub-neg92.1%
+-commutative92.1%
associate--r+92.1%
neg-sub092.1%
remove-double-neg92.1%
Simplified92.1%
Final simplification92.0%
(FPCore (x y z t a)
:precision binary64
(if (<= x -8e+54)
(+ (* a 120.0) (* 60.0 (/ x (- z t))))
(if (<= x 2.4e+20)
(+ (* a 120.0) (* y (/ -60.0 (- 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 (x <= -8e+54) {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
} else if (x <= 2.4e+20) {
tmp = (a * 120.0) + (y * (-60.0 / (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 (x <= (-8d+54)) then
tmp = (a * 120.0d0) + (60.0d0 * (x / (z - t)))
else if (x <= 2.4d+20) then
tmp = (a * 120.0d0) + (y * ((-60.0d0) / (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 (x <= -8e+54) {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
} else if (x <= 2.4e+20) {
tmp = (a * 120.0) + (y * (-60.0 / (z - t)));
} else {
tmp = (a * 120.0) + (60.0 / ((z - t) / x));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -8e+54: tmp = (a * 120.0) + (60.0 * (x / (z - t))) elif x <= 2.4e+20: tmp = (a * 120.0) + (y * (-60.0 / (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 (x <= -8e+54) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); elseif (x <= 2.4e+20) tmp = Float64(Float64(a * 120.0) + Float64(y * Float64(-60.0 / 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 (x <= -8e+54) tmp = (a * 120.0) + (60.0 * (x / (z - t))); elseif (x <= 2.4e+20) tmp = (a * 120.0) + (y * (-60.0 / (z - t))); else tmp = (a * 120.0) + (60.0 / ((z - t) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -8e+54], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.4e+20], N[(N[(a * 120.0), $MachinePrecision] + N[(y * N[(-60.0 / 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}\;x \leq -8 \cdot 10^{+54}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+20}:\\
\;\;\;\;a \cdot 120 + y \cdot \frac{-60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{z - t}{x}}\\
\end{array}
\end{array}
if x < -8.0000000000000006e54Initial program 94.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 91.4%
if -8.0000000000000006e54 < x < 2.4e20Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 92.1%
associate-*r/92.1%
Simplified92.1%
*-commutative92.1%
associate-/l*92.1%
Applied egg-rr92.1%
if 2.4e20 < x Initial program 99.8%
associate-/l*99.7%
Simplified99.7%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 92.6%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (+ (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (a * 120.0d0) + (60.0d0 * ((x - y) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
def code(x, y, z, t, a): return (a * 120.0) + (60.0 * ((x - y) / (z - t)))
function code(x, y, z, t, a) return Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = (a * 120.0) + (60.0 * ((x - y) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120 + 60 \cdot \frac{x - y}{z - t}
\end{array}
Initial program 98.6%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (* a 120.0))
double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = a * 120.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
def code(x, y, z, t, a): return a * 120.0
function code(x, y, z, t, a) return Float64(a * 120.0) end
function tmp = code(x, y, z, t, a) tmp = a * 120.0; end
code[x_, y_, z_, t_, a_] := N[(a * 120.0), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120
\end{array}
Initial program 98.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 51.8%
Final simplification51.8%
(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 2024112
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))