
(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 (+ (* (- 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.0%
*-commutative99.0%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (or (<= (* a 120.0) -1e+31)
(not
(or (<= (* a 120.0) -2e-85)
(and (not (<= (* a 120.0) -4e-139)) (<= (* a 120.0) 5e-76)))))
(* 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+31) || !(((a * 120.0) <= -2e-85) || (!((a * 120.0) <= -4e-139) && ((a * 120.0) <= 5e-76)))) {
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+31)) .or. (.not. ((a * 120.0d0) <= (-2d-85)) .or. (.not. ((a * 120.0d0) <= (-4d-139))) .and. ((a * 120.0d0) <= 5d-76))) 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+31) || !(((a * 120.0) <= -2e-85) || (!((a * 120.0) <= -4e-139) && ((a * 120.0) <= 5e-76)))) {
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+31) or not (((a * 120.0) <= -2e-85) or (not ((a * 120.0) <= -4e-139) and ((a * 120.0) <= 5e-76))): 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+31) || !((Float64(a * 120.0) <= -2e-85) || (!(Float64(a * 120.0) <= -4e-139) && (Float64(a * 120.0) <= 5e-76)))) 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+31) || ~((((a * 120.0) <= -2e-85) || (~(((a * 120.0) <= -4e-139)) && ((a * 120.0) <= 5e-76))))) 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+31], N[Not[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -2e-85], And[N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], -4e-139]], $MachinePrecision], LessEqual[N[(a * 120.0), $MachinePrecision], 5e-76]]]], $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^{+31} \lor \neg \left(a \cdot 120 \leq -2 \cdot 10^{-85} \lor \neg \left(a \cdot 120 \leq -4 \cdot 10^{-139}\right) \land a \cdot 120 \leq 5 \cdot 10^{-76}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.9999999999999996e30 or -2e-85 < (*.f64 a #s(literal 120 binary64)) < -4.00000000000000012e-139 or 4.9999999999999998e-76 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.4%
if -9.9999999999999996e30 < (*.f64 a #s(literal 120 binary64)) < -2e-85 or -4.00000000000000012e-139 < (*.f64 a #s(literal 120 binary64)) < 4.9999999999999998e-76Initial program 97.8%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 82.5%
Final simplification78.3%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -1e+31)
(+ (* a 120.0) (* -60.0 (/ y z)))
(if (or (<= (* a 120.0) -2e-85)
(and (not (<= (* a 120.0) -4e-139)) (<= (* a 120.0) 5e-76)))
(* 60.0 (/ (- x y) (- z t)))
(* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -1e+31) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (((a * 120.0) <= -2e-85) || (!((a * 120.0) <= -4e-139) && ((a * 120.0) <= 5e-76))) {
tmp = 60.0 * ((x - y) / (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 ((a * 120.0d0) <= (-1d+31)) then
tmp = (a * 120.0d0) + ((-60.0d0) * (y / z))
else if (((a * 120.0d0) <= (-2d-85)) .or. (.not. ((a * 120.0d0) <= (-4d-139))) .and. ((a * 120.0d0) <= 5d-76)) then
tmp = 60.0d0 * ((x - y) / (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 ((a * 120.0) <= -1e+31) {
tmp = (a * 120.0) + (-60.0 * (y / z));
} else if (((a * 120.0) <= -2e-85) || (!((a * 120.0) <= -4e-139) && ((a * 120.0) <= 5e-76))) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -1e+31: tmp = (a * 120.0) + (-60.0 * (y / z)) elif ((a * 120.0) <= -2e-85) or (not ((a * 120.0) <= -4e-139) and ((a * 120.0) <= 5e-76)): tmp = 60.0 * ((x - y) / (z - t)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -1e+31) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(y / z))); elseif ((Float64(a * 120.0) <= -2e-85) || (!(Float64(a * 120.0) <= -4e-139) && (Float64(a * 120.0) <= 5e-76))) tmp = Float64(60.0 * Float64(Float64(x - y) / 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 ((a * 120.0) <= -1e+31) tmp = (a * 120.0) + (-60.0 * (y / z)); elseif (((a * 120.0) <= -2e-85) || (~(((a * 120.0) <= -4e-139)) && ((a * 120.0) <= 5e-76))) tmp = 60.0 * ((x - y) / (z - t)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -1e+31], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -2e-85], And[N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], -4e-139]], $MachinePrecision], LessEqual[N[(a * 120.0), $MachinePrecision], 5e-76]]], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -1 \cdot 10^{+31}:\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{y}{z}\\
\mathbf{elif}\;a \cdot 120 \leq -2 \cdot 10^{-85} \lor \neg \left(a \cdot 120 \leq -4 \cdot 10^{-139}\right) \land a \cdot 120 \leq 5 \cdot 10^{-76}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -9.9999999999999996e30Initial program 99.8%
*-commutative99.8%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 75.4%
Taylor expanded in x around 0 78.3%
if -9.9999999999999996e30 < (*.f64 a #s(literal 120 binary64)) < -2e-85 or -4.00000000000000012e-139 < (*.f64 a #s(literal 120 binary64)) < 4.9999999999999998e-76Initial program 97.8%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 82.5%
if -2e-85 < (*.f64 a #s(literal 120 binary64)) < -4.00000000000000012e-139 or 4.9999999999999998e-76 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 74.0%
Final simplification78.5%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -3.1e+28)
(and (not (<= a -1.42e-37))
(or (<= a -1.15e-151) (not (<= a 1.1e-74)))))
(* a 120.0)
(* x (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.1e+28) || (!(a <= -1.42e-37) && ((a <= -1.15e-151) || !(a <= 1.1e-74)))) {
tmp = a * 120.0;
} else {
tmp = x * (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 <= (-3.1d+28)) .or. (.not. (a <= (-1.42d-37))) .and. (a <= (-1.15d-151)) .or. (.not. (a <= 1.1d-74))) then
tmp = a * 120.0d0
else
tmp = x * (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 <= -3.1e+28) || (!(a <= -1.42e-37) && ((a <= -1.15e-151) || !(a <= 1.1e-74)))) {
tmp = a * 120.0;
} else {
tmp = x * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.1e+28) or (not (a <= -1.42e-37) and ((a <= -1.15e-151) or not (a <= 1.1e-74))): tmp = a * 120.0 else: tmp = x * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.1e+28) || (!(a <= -1.42e-37) && ((a <= -1.15e-151) || !(a <= 1.1e-74)))) tmp = Float64(a * 120.0); else tmp = Float64(x * Float64(60.0 / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.1e+28) || (~((a <= -1.42e-37)) && ((a <= -1.15e-151) || ~((a <= 1.1e-74))))) tmp = a * 120.0; else tmp = x * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.1e+28], And[N[Not[LessEqual[a, -1.42e-37]], $MachinePrecision], Or[LessEqual[a, -1.15e-151], N[Not[LessEqual[a, 1.1e-74]], $MachinePrecision]]]], N[(a * 120.0), $MachinePrecision], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+28} \lor \neg \left(a \leq -1.42 \cdot 10^{-37}\right) \land \left(a \leq -1.15 \cdot 10^{-151} \lor \neg \left(a \leq 1.1 \cdot 10^{-74}\right)\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if a < -3.1000000000000001e28 or -1.42e-37 < a < -1.14999999999999998e-151 or 1.10000000000000005e-74 < a Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 71.3%
if -3.1000000000000001e28 < a < -1.42e-37 or -1.14999999999999998e-151 < a < 1.10000000000000005e-74Initial program 97.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around inf 89.5%
Taylor expanded in x around inf 56.2%
Final simplification66.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -4e-139) (not (<= (* a 120.0) 5e-138))) (+ (* a 120.0) (* x (/ 60.0 (- z t)))) (* 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-139) || !((a * 120.0) <= 5e-138)) {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
} 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-139)) .or. (.not. ((a * 120.0d0) <= 5d-138))) then
tmp = (a * 120.0d0) + (x * (60.0d0 / (z - t)))
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-139) || !((a * 120.0) <= 5e-138)) {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -4e-139) or not ((a * 120.0) <= 5e-138): tmp = (a * 120.0) + (x * (60.0 / (z - t))) 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-139) || !(Float64(a * 120.0) <= 5e-138)) tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t)))); 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-139) || ~(((a * 120.0) <= 5e-138))) tmp = (a * 120.0) + (x * (60.0 / (z - t))); 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], -4e-139], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 5e-138]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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^{-139} \lor \neg \left(a \cdot 120 \leq 5 \cdot 10^{-138}\right):\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -4.00000000000000012e-139 or 4.99999999999999989e-138 < (*.f64 a #s(literal 120 binary64)) Initial program 99.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 86.6%
associate-*r/86.1%
*-commutative86.1%
associate-*r/86.6%
Simplified86.6%
if -4.00000000000000012e-139 < (*.f64 a #s(literal 120 binary64)) < 4.99999999999999989e-138Initial program 98.2%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in a around 0 88.8%
Final simplification87.2%
(FPCore (x y z t a)
:precision binary64
(if (<= y 7.7e-240)
(* a 120.0)
(if (<= y 5.5e-163)
(* 60.0 (/ x z))
(if (<= y 3.3e+102) (* a 120.0) (* -60.0 (/ y (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 7.7e-240) {
tmp = a * 120.0;
} else if (y <= 5.5e-163) {
tmp = 60.0 * (x / z);
} else if (y <= 3.3e+102) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 7.7d-240) then
tmp = a * 120.0d0
else if (y <= 5.5d-163) then
tmp = 60.0d0 * (x / z)
else if (y <= 3.3d+102) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (y / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 7.7e-240) {
tmp = a * 120.0;
} else if (y <= 5.5e-163) {
tmp = 60.0 * (x / z);
} else if (y <= 3.3e+102) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 7.7e-240: tmp = a * 120.0 elif y <= 5.5e-163: tmp = 60.0 * (x / z) elif y <= 3.3e+102: tmp = a * 120.0 else: tmp = -60.0 * (y / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 7.7e-240) tmp = Float64(a * 120.0); elseif (y <= 5.5e-163) tmp = Float64(60.0 * Float64(x / z)); elseif (y <= 3.3e+102) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(y / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 7.7e-240) tmp = a * 120.0; elseif (y <= 5.5e-163) tmp = 60.0 * (x / z); elseif (y <= 3.3e+102) tmp = a * 120.0; else tmp = -60.0 * (y / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 7.7e-240], N[(a * 120.0), $MachinePrecision], If[LessEqual[y, 5.5e-163], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+102], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.7 \cdot 10^{-240}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-163}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+102}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\end{array}
\end{array}
if y < 7.7e-240 or 5.4999999999999998e-163 < y < 3.29999999999999999e102Initial program 99.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 60.3%
if 7.7e-240 < y < 5.4999999999999998e-163Initial program 93.6%
*-commutative93.6%
associate-/l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 70.2%
Taylor expanded in x around inf 70.2%
Taylor expanded in x around inf 60.4%
if 3.29999999999999999e102 < y Initial program 99.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 73.7%
Taylor expanded in a around inf 60.9%
Taylor expanded in y around inf 60.6%
Final simplification60.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.25e+218) (not (<= y 5.5e+42))) (+ (* a 120.0) (/ (* y -60.0) (- z t))) (+ (* a 120.0) (* x (/ 60.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.25e+218) || !(y <= 5.5e+42)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (a * 120.0) + (x * (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 ((y <= (-2.25d+218)) .or. (.not. (y <= 5.5d+42))) then
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
else
tmp = (a * 120.0d0) + (x * (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 ((y <= -2.25e+218) || !(y <= 5.5e+42)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.25e+218) or not (y <= 5.5e+42): tmp = (a * 120.0) + ((y * -60.0) / (z - t)) else: tmp = (a * 120.0) + (x * (60.0 / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.25e+218) || !(y <= 5.5e+42)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.25e+218) || ~((y <= 5.5e+42))) tmp = (a * 120.0) + ((y * -60.0) / (z - t)); else tmp = (a * 120.0) + (x * (60.0 / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.25e+218], N[Not[LessEqual[y, 5.5e+42]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+218} \lor \neg \left(y \leq 5.5 \cdot 10^{+42}\right):\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if y < -2.25000000000000004e218 or 5.50000000000000001e42 < y Initial program 98.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 89.1%
associate-*r/89.1%
Simplified89.1%
if -2.25000000000000004e218 < y < 5.50000000000000001e42Initial program 99.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 92.7%
associate-*r/92.1%
*-commutative92.1%
associate-*r/92.7%
Simplified92.7%
Final simplification91.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.15e+32)
(+ (* a 120.0) (* (- x y) (/ -60.0 t)))
(if (<= t 1.8e-56)
(+ (* a 120.0) (* (- x y) (/ 60.0 z)))
(+ (* a 120.0) (* x (/ 60.0 (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e+32) {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
} else if (t <= 1.8e-56) {
tmp = (a * 120.0) + ((x - y) * (60.0 / z));
} else {
tmp = (a * 120.0) + (x * (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 (t <= (-1.15d+32)) then
tmp = (a * 120.0d0) + ((x - y) * ((-60.0d0) / t))
else if (t <= 1.8d-56) then
tmp = (a * 120.0d0) + ((x - y) * (60.0d0 / z))
else
tmp = (a * 120.0d0) + (x * (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 (t <= -1.15e+32) {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
} else if (t <= 1.8e-56) {
tmp = (a * 120.0) + ((x - y) * (60.0 / z));
} else {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e+32: tmp = (a * 120.0) + ((x - y) * (-60.0 / t)) elif t <= 1.8e-56: tmp = (a * 120.0) + ((x - y) * (60.0 / z)) else: tmp = (a * 120.0) + (x * (60.0 / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e+32) tmp = Float64(Float64(a * 120.0) + Float64(Float64(x - y) * Float64(-60.0 / t))); elseif (t <= 1.8e-56) tmp = Float64(Float64(a * 120.0) + Float64(Float64(x - y) * Float64(60.0 / z))); else tmp = Float64(Float64(a * 120.0) + Float64(x * Float64(60.0 / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.15e+32) tmp = (a * 120.0) + ((x - y) * (-60.0 / t)); elseif (t <= 1.8e-56) tmp = (a * 120.0) + ((x - y) * (60.0 / z)); else tmp = (a * 120.0) + (x * (60.0 / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e+32], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-56], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] * N[(60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+32}:\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-56}:\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{60}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if t < -1.15e32Initial program 97.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 94.2%
associate-*r/92.3%
*-commutative92.3%
associate-/l*94.2%
Simplified94.2%
if -1.15e32 < t < 1.79999999999999989e-56Initial program 99.0%
*-commutative99.0%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 87.9%
if 1.79999999999999989e-56 < t Initial program 99.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 87.2%
associate-*r/87.2%
*-commutative87.2%
associate-*r/87.2%
Simplified87.2%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.8e-260) (not (<= a 2.3e-133))) (* a 120.0) (* -60.0 (/ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.8e-260) || !(a <= 2.3e-133)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.8d-260)) .or. (.not. (a <= 2.3d-133))) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.8e-260) || !(a <= 2.3e-133)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.8e-260) or not (a <= 2.3e-133): tmp = a * 120.0 else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.8e-260) || !(a <= 2.3e-133)) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.8e-260) || ~((a <= 2.3e-133))) tmp = a * 120.0; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.8e-260], N[Not[LessEqual[a, 2.3e-133]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-260} \lor \neg \left(a \leq 2.3 \cdot 10^{-133}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if a < -2.7999999999999998e-260 or 2.3e-133 < a Initial program 98.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 60.9%
if -2.7999999999999998e-260 < a < 2.3e-133Initial program 99.7%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in z around 0 49.0%
associate-*r/49.0%
*-commutative49.0%
associate-/l*49.2%
Simplified49.2%
Taylor expanded in x around inf 34.8%
Taylor expanded in x around inf 28.5%
Final simplification55.5%
(FPCore (x y z t a) :precision binary64 (+ (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (a * 120.0d0) + (60.0d0 * ((x - y) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * 120.0) + (60.0 * ((x - y) / (z - t)));
}
def code(x, y, z, t, a): return (a * 120.0) + (60.0 * ((x - y) / (z - t)))
function code(x, y, z, t, a) return Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = (a * 120.0) + (60.0 * ((x - y) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120 + 60 \cdot \frac{x - y}{z - t}
\end{array}
Initial program 99.0%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.9e+197) (* 60.0 (/ x z)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.9e+197) {
tmp = 60.0 * (x / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-4.9d+197)) then
tmp = 60.0d0 * (x / z)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.9e+197) {
tmp = 60.0 * (x / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.9e+197: tmp = 60.0 * (x / z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.9e+197) tmp = Float64(60.0 * Float64(x / z)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.9e+197) tmp = 60.0 * (x / z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.9e+197], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{+197}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -4.90000000000000026e197Initial program 96.2%
*-commutative96.2%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 78.4%
Taylor expanded in x around inf 74.9%
Taylor expanded in x around inf 58.9%
if -4.90000000000000026e197 < x Initial program 99.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 55.9%
Final simplification56.3%
(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.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 52.2%
Final simplification52.2%
(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 2024078
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))