
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma 60.0 (/ (- x y) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return fma(60.0, ((x - y) / (z - t)), (a * 120.0));
}
function code(x, y, z, t, a) return fma(60.0, Float64(Float64(x - y) / Float64(z - t)), Float64(a * 120.0)) end
code[x_, y_, z_, t_, a_] := N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(60, \frac{x - y}{z - t}, a \cdot 120\right)
\end{array}
Initial program 97.9%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -5e+42) (not (<= t_1 1e+100)))
(/ 60.0 (/ (- z t) (- x y)))
(+ (* a 120.0) (* 60.0 (/ x (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+42) || !(t_1 <= 1e+100)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = (a * 120.0) + (60.0 * (x / (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) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if ((t_1 <= (-5d+42)) .or. (.not. (t_1 <= 1d+100))) then
tmp = 60.0d0 / ((z - t) / (x - y))
else
tmp = (a * 120.0d0) + (60.0d0 * (x / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+42) || !(t_1 <= 1e+100)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if (t_1 <= -5e+42) or not (t_1 <= 1e+100): tmp = 60.0 / ((z - t) / (x - y)) else: tmp = (a * 120.0) + (60.0 * (x / (z - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -5e+42) || !(t_1 <= 1e+100)) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if ((t_1 <= -5e+42) || ~((t_1 <= 1e+100))) tmp = 60.0 / ((z - t) / (x - y)); else tmp = (a * 120.0) + (60.0 * (x / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+42], N[Not[LessEqual[t$95$1, 1e+100]], $MachinePrecision]], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+42} \lor \neg \left(t\_1 \leq 10^{+100}\right):\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -5.00000000000000007e42 or 1.00000000000000002e100 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) Initial program 94.4%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 84.5%
clear-num84.4%
un-div-inv84.5%
Applied egg-rr84.5%
if -5.00000000000000007e42 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 1.00000000000000002e100Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 86.3%
Final simplification85.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -5e+42) (not (<= t_1 1e+100)))
(/ 60.0 (/ (- z t) (- x y)))
(+ (* a 120.0) (* x (/ 60.0 (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+42) || !(t_1 <= 1e+100)) {
tmp = 60.0 / ((z - t) / (x - y));
} 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) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if ((t_1 <= (-5d+42)) .or. (.not. (t_1 <= 1d+100))) then
tmp = 60.0d0 / ((z - t) / (x - y))
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 t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e+42) || !(t_1 <= 1e+100)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = (a * 120.0) + (x * (60.0 / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if (t_1 <= -5e+42) or not (t_1 <= 1e+100): tmp = 60.0 / ((z - t) / (x - y)) else: tmp = (a * 120.0) + (x * (60.0 / (z - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -5e+42) || !(t_1 <= 1e+100)) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); 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) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if ((t_1 <= -5e+42) || ~((t_1 <= 1e+100))) tmp = 60.0 / ((z - t) / (x - y)); else tmp = (a * 120.0) + (x * (60.0 / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+42], N[Not[LessEqual[t$95$1, 1e+100]], $MachinePrecision]], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $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}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+42} \lor \neg \left(t\_1 \leq 10^{+100}\right):\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + x \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -5.00000000000000007e42 or 1.00000000000000002e100 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) Initial program 94.4%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 84.5%
clear-num84.4%
un-div-inv84.5%
Applied egg-rr84.5%
if -5.00000000000000007e42 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 1.00000000000000002e100Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 86.3%
associate-*r/86.3%
*-commutative86.3%
associate-*r/86.3%
Simplified86.3%
Final simplification85.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+23)
(/ 60.0 (/ (- z t) (- x y)))
(if (<= t_1 5e-35) (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+23) {
tmp = 60.0 / ((z - t) / (x - y));
} else if (t_1 <= 5e-35) {
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) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-2d+23)) then
tmp = 60.0d0 / ((z - t) / (x - y))
else if (t_1 <= 5d-35) 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 t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+23) {
tmp = 60.0 / ((z - t) / (x - y));
} else if (t_1 <= 5e-35) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+23: tmp = 60.0 / ((z - t) / (x - y)) elif t_1 <= 5e-35: tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / (z - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+23) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); elseif (t_1 <= 5e-35) 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) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -2e+23) tmp = 60.0 / ((z - t) / (x - y)); elseif (t_1 <= 5e-35) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+23], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-35], 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}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+23}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-35}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -1.9999999999999998e23Initial program 92.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 79.3%
clear-num79.2%
un-div-inv79.4%
Applied egg-rr79.4%
if -1.9999999999999998e23 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 4.99999999999999964e-35Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 78.9%
if 4.99999999999999964e-35 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) Initial program 98.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 73.2%
Final simplification77.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= x -1.3e+119)
(and (not (<= x -0.0275))
(or (<= x -1.16e-33) (not (<= x 2.2e+102)))))
(* 60.0 (/ x (- z t)))
(* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.3e+119) || (!(x <= -0.0275) && ((x <= -1.16e-33) || !(x <= 2.2e+102)))) {
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 <= (-1.3d+119)) .or. (.not. (x <= (-0.0275d0))) .and. (x <= (-1.16d-33)) .or. (.not. (x <= 2.2d+102))) 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 <= -1.3e+119) || (!(x <= -0.0275) && ((x <= -1.16e-33) || !(x <= 2.2e+102)))) {
tmp = 60.0 * (x / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -1.3e+119) or (not (x <= -0.0275) and ((x <= -1.16e-33) or not (x <= 2.2e+102))): 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 <= -1.3e+119) || (!(x <= -0.0275) && ((x <= -1.16e-33) || !(x <= 2.2e+102)))) 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 <= -1.3e+119) || (~((x <= -0.0275)) && ((x <= -1.16e-33) || ~((x <= 2.2e+102))))) 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, -1.3e+119], And[N[Not[LessEqual[x, -0.0275]], $MachinePrecision], Or[LessEqual[x, -1.16e-33], N[Not[LessEqual[x, 2.2e+102]], $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 -1.3 \cdot 10^{+119} \lor \neg \left(x \leq -0.0275\right) \land \left(x \leq -1.16 \cdot 10^{-33} \lor \neg \left(x \leq 2.2 \cdot 10^{+102}\right)\right):\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -1.3e119 or -0.0275000000000000001 < x < -1.1600000000000001e-33 or 2.20000000000000007e102 < x Initial program 93.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 71.4%
Taylor expanded in x around inf 58.3%
if -1.3e119 < x < -0.0275000000000000001 or -1.1600000000000001e-33 < x < 2.20000000000000007e102Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 63.0%
Final simplification61.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -9.7e+51)
(* a 120.0)
(if (<= t -3.6e-82)
(* -60.0 (/ (- x y) t))
(if (or (<= t -1.9e-122) (not (<= t 1.8e-94)))
(* a 120.0)
(* 60.0 (/ (- x y) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.7e+51) {
tmp = a * 120.0;
} else if (t <= -3.6e-82) {
tmp = -60.0 * ((x - y) / t);
} else if ((t <= -1.9e-122) || !(t <= 1.8e-94)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-9.7d+51)) then
tmp = a * 120.0d0
else if (t <= (-3.6d-82)) then
tmp = (-60.0d0) * ((x - y) / t)
else if ((t <= (-1.9d-122)) .or. (.not. (t <= 1.8d-94))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * ((x - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.7e+51) {
tmp = a * 120.0;
} else if (t <= -3.6e-82) {
tmp = -60.0 * ((x - y) / t);
} else if ((t <= -1.9e-122) || !(t <= 1.8e-94)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.7e+51: tmp = a * 120.0 elif t <= -3.6e-82: tmp = -60.0 * ((x - y) / t) elif (t <= -1.9e-122) or not (t <= 1.8e-94): tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.7e+51) tmp = Float64(a * 120.0); elseif (t <= -3.6e-82) tmp = Float64(-60.0 * Float64(Float64(x - y) / t)); elseif ((t <= -1.9e-122) || !(t <= 1.8e-94)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(Float64(x - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.7e+51) tmp = a * 120.0; elseif (t <= -3.6e-82) tmp = -60.0 * ((x - y) / t); elseif ((t <= -1.9e-122) || ~((t <= 1.8e-94))) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.7e+51], N[(a * 120.0), $MachinePrecision], If[LessEqual[t, -3.6e-82], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.9e-122], N[Not[LessEqual[t, 1.8e-94]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.7 \cdot 10^{+51}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-82}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-122} \lor \neg \left(t \leq 1.8 \cdot 10^{-94}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if t < -9.7000000000000002e51 or -3.59999999999999998e-82 < t < -1.9e-122 or 1.8e-94 < t Initial program 97.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 69.7%
if -9.7000000000000002e51 < t < -3.59999999999999998e-82Initial program 92.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 75.3%
Taylor expanded in z around 0 51.9%
if -1.9e-122 < t < 1.8e-94Initial program 99.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 72.0%
Taylor expanded in z around inf 60.6%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -500000.0) (not (<= (* a 120.0) 1e+23))) (+ (* a 120.0) (* -60.0 (/ x 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) <= -500000.0) || !((a * 120.0) <= 1e+23)) {
tmp = (a * 120.0) + (-60.0 * (x / 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) <= (-500000.0d0)) .or. (.not. ((a * 120.0d0) <= 1d+23))) then
tmp = (a * 120.0d0) + ((-60.0d0) * (x / 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) <= -500000.0) || !((a * 120.0) <= 1e+23)) {
tmp = (a * 120.0) + (-60.0 * (x / t));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -500000.0) or not ((a * 120.0) <= 1e+23): tmp = (a * 120.0) + (-60.0 * (x / 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) <= -500000.0) || !(Float64(a * 120.0) <= 1e+23)) tmp = Float64(Float64(a * 120.0) + Float64(-60.0 * Float64(x / 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) <= -500000.0) || ~(((a * 120.0) <= 1e+23))) tmp = (a * 120.0) + (-60.0 * (x / 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], -500000.0], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e+23]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(-60.0 * N[(x / t), $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 -500000 \lor \neg \left(a \cdot 120 \leq 10^{+23}\right):\\
\;\;\;\;a \cdot 120 + -60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a 120) < -5e5 or 9.9999999999999992e22 < (*.f64 a 120) Initial program 99.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 88.2%
Taylor expanded in z around 0 79.4%
if -5e5 < (*.f64 a 120) < 9.9999999999999992e22Initial program 96.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 73.5%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.02e-45) (not (<= t 8.8e-7))) (+ (* a 120.0) (* (- x y) (/ -60.0 t))) (+ (* a 120.0) (/ 60.0 (/ z (- x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.02e-45) || !(t <= 8.8e-7)) {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
} else {
tmp = (a * 120.0) + (60.0 / (z / (x - y)));
}
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.02d-45)) .or. (.not. (t <= 8.8d-7))) then
tmp = (a * 120.0d0) + ((x - y) * ((-60.0d0) / t))
else
tmp = (a * 120.0d0) + (60.0d0 / (z / (x - y)))
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.02e-45) || !(t <= 8.8e-7)) {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
} else {
tmp = (a * 120.0) + (60.0 / (z / (x - y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.02e-45) or not (t <= 8.8e-7): tmp = (a * 120.0) + ((x - y) * (-60.0 / t)) else: tmp = (a * 120.0) + (60.0 / (z / (x - y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.02e-45) || !(t <= 8.8e-7)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(x - y) * Float64(-60.0 / t))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 / Float64(z / Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.02e-45) || ~((t <= 8.8e-7))) tmp = (a * 120.0) + ((x - y) * (-60.0 / t)); else tmp = (a * 120.0) + (60.0 / (z / (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.02e-45], N[Not[LessEqual[t, 8.8e-7]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{-45} \lor \neg \left(t \leq 8.8 \cdot 10^{-7}\right):\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{60}{\frac{z}{x - y}}\\
\end{array}
\end{array}
if t < -1.0199999999999999e-45 or 8.8000000000000004e-7 < t Initial program 97.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 90.2%
associate-*r/88.1%
*-commutative88.1%
associate-/l*90.2%
Simplified90.2%
if -1.0199999999999999e-45 < t < 8.8000000000000004e-7Initial program 99.0%
associate-/l*99.8%
Simplified99.8%
clear-num64.2%
un-div-inv64.3%
Applied egg-rr99.6%
Taylor expanded in z around inf 83.4%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.1e+109) (not (<= y 2.3e+50))) (+ (* a 120.0) (/ (* y -60.0) (- z t))) (+ (* a 120.0) (* 60.0 (/ x (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.1e+109) || !(y <= 2.3e+50)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (a * 120.0) + (60.0 * (x / (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.1d+109)) .or. (.not. (y <= 2.3d+50))) then
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
else
tmp = (a * 120.0d0) + (60.0d0 * (x / (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.1e+109) || !(y <= 2.3e+50)) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else {
tmp = (a * 120.0) + (60.0 * (x / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.1e+109) or not (y <= 2.3e+50): tmp = (a * 120.0) + ((y * -60.0) / (z - t)) else: tmp = (a * 120.0) + (60.0 * (x / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.1e+109) || !(y <= 2.3e+50)) tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.1e+109) || ~((y <= 2.3e+50))) tmp = (a * 120.0) + ((y * -60.0) / (z - t)); else tmp = (a * 120.0) + (60.0 * (x / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.1e+109], N[Not[LessEqual[y, 2.3e+50]], $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[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+109} \lor \neg \left(y \leq 2.3 \cdot 10^{+50}\right):\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if y < -2.1000000000000001e109 or 2.29999999999999997e50 < y Initial program 95.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 90.3%
associate-*r/88.4%
Simplified88.4%
if -2.1000000000000001e109 < y < 2.29999999999999997e50Initial program 99.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 91.2%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -61.0) (not (<= a 6.4e+21))) (* 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 <= -61.0) || !(a <= 6.4e+21)) {
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 <= (-61.0d0)) .or. (.not. (a <= 6.4d+21))) 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 <= -61.0) || !(a <= 6.4e+21)) {
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 <= -61.0) or not (a <= 6.4e+21): tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -61.0) || !(a <= 6.4e+21)) 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 <= -61.0) || ~((a <= 6.4e+21))) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -61.0], N[Not[LessEqual[a, 6.4e+21]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -61 \lor \neg \left(a \leq 6.4 \cdot 10^{+21}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if a < -61 or 6.4e21 < a Initial program 99.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 77.1%
if -61 < a < 6.4e21Initial program 96.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 73.5%
Final simplification75.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.1e-109) (not (<= a 1.15e-76))) (* a 120.0) (* -60.0 (/ (- x y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.1e-109) || !(a <= 1.15e-76)) {
tmp = a * 120.0;
} else {
tmp = -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 ((a <= (-2.1d-109)) .or. (.not. (a <= 1.15d-76))) then
tmp = a * 120.0d0
else
tmp = (-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 ((a <= -2.1e-109) || !(a <= 1.15e-76)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * ((x - y) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.1e-109) or not (a <= 1.15e-76): tmp = a * 120.0 else: tmp = -60.0 * ((x - y) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.1e-109) || !(a <= 1.15e-76)) tmp = Float64(a * 120.0); else tmp = 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 ((a <= -2.1e-109) || ~((a <= 1.15e-76))) tmp = a * 120.0; else tmp = -60.0 * ((x - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.1e-109], N[Not[LessEqual[a, 1.15e-76]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{-109} \lor \neg \left(a \leq 1.15 \cdot 10^{-76}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if a < -2.09999999999999996e-109 or 1.15000000000000003e-76 < a Initial program 97.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 66.0%
if -2.09999999999999996e-109 < a < 1.15000000000000003e-76Initial program 98.6%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 76.7%
Taylor expanded in z around 0 46.1%
Final simplification58.8%
(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 97.9%
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 97.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 51.2%
Final simplification51.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 2024051
(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)))