
(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 (+ (/ 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}
Initial program 99.5%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -5e-25) (not (<= (* a 120.0) 2e-30))) (+ (* x (/ 60.0 (- z t))) (* a 120.0)) (/ 60.0 (/ (- z t) (- x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -5e-25) || !((a * 120.0) <= 2e-30)) {
tmp = (x * (60.0 / (z - t))) + (a * 120.0);
} else {
tmp = 60.0 / ((z - t) / (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 (((a * 120.0d0) <= (-5d-25)) .or. (.not. ((a * 120.0d0) <= 2d-30))) then
tmp = (x * (60.0d0 / (z - t))) + (a * 120.0d0)
else
tmp = 60.0d0 / ((z - t) / (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 (((a * 120.0) <= -5e-25) || !((a * 120.0) <= 2e-30)) {
tmp = (x * (60.0 / (z - t))) + (a * 120.0);
} else {
tmp = 60.0 / ((z - t) / (x - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -5e-25) or not ((a * 120.0) <= 2e-30): tmp = (x * (60.0 / (z - t))) + (a * 120.0) else: tmp = 60.0 / ((z - t) / (x - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -5e-25) || !(Float64(a * 120.0) <= 2e-30)) tmp = Float64(Float64(x * Float64(60.0 / Float64(z - t))) + Float64(a * 120.0)); else tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -5e-25) || ~(((a * 120.0) <= 2e-30))) tmp = (x * (60.0 / (z - t))) + (a * 120.0); else tmp = 60.0 / ((z - t) / (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -5e-25], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-30]], $MachinePrecision]], N[(N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-25} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-30}\right):\\
\;\;\;\;x \cdot \frac{60}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -4.99999999999999962e-25 or 2e-30 < (*.f64 a #s(literal 120 binary64)) Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 90.2%
associate-*r/89.4%
*-commutative89.4%
associate-*r/90.1%
Simplified90.1%
if -4.99999999999999962e-25 < (*.f64 a #s(literal 120 binary64)) < 2e-30Initial program 99.7%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 79.0%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr79.0%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -5e-25) (not (<= (* a 120.0) 2e-30))) (* 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) <= -5e-25) || !((a * 120.0) <= 2e-30)) {
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) <= (-5d-25)) .or. (.not. ((a * 120.0d0) <= 2d-30))) 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) <= -5e-25) || !((a * 120.0) <= 2e-30)) {
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) <= -5e-25) or not ((a * 120.0) <= 2e-30): 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) <= -5e-25) || !(Float64(a * 120.0) <= 2e-30)) 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) <= -5e-25) || ~(((a * 120.0) <= 2e-30))) 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], -5e-25], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-30]], $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 -5 \cdot 10^{-25} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-30}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -4.99999999999999962e-25 or 2e-30 < (*.f64 a #s(literal 120 binary64)) Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 82.4%
if -4.99999999999999962e-25 < (*.f64 a #s(literal 120 binary64)) < 2e-30Initial program 99.7%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 79.0%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -5e-25) (not (<= (* a 120.0) 2e-30))) (* a 120.0) (/ 60.0 (/ (- z t) (- x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -5e-25) || !((a * 120.0) <= 2e-30)) {
tmp = a * 120.0;
} else {
tmp = 60.0 / ((z - t) / (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 (((a * 120.0d0) <= (-5d-25)) .or. (.not. ((a * 120.0d0) <= 2d-30))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 / ((z - t) / (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 (((a * 120.0) <= -5e-25) || !((a * 120.0) <= 2e-30)) {
tmp = a * 120.0;
} else {
tmp = 60.0 / ((z - t) / (x - y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -5e-25) or not ((a * 120.0) <= 2e-30): tmp = a * 120.0 else: tmp = 60.0 / ((z - t) / (x - y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 120.0) <= -5e-25) || !(Float64(a * 120.0) <= 2e-30)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a * 120.0) <= -5e-25) || ~(((a * 120.0) <= 2e-30))) tmp = a * 120.0; else tmp = 60.0 / ((z - t) / (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 120.0), $MachinePrecision], -5e-25], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 2e-30]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -5 \cdot 10^{-25} \lor \neg \left(a \cdot 120 \leq 2 \cdot 10^{-30}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -4.99999999999999962e-25 or 2e-30 < (*.f64 a #s(literal 120 binary64)) Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 82.4%
if -4.99999999999999962e-25 < (*.f64 a #s(literal 120 binary64)) < 2e-30Initial program 99.7%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 79.0%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr79.0%
Final simplification80.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.3e-28)
(* a 120.0)
(if (<= a -5.6e-270)
(* 60.0 (/ (- x y) z))
(if (<= a 3.5e-30) (* -60.0 (/ (- x y) t)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.3e-28) {
tmp = a * 120.0;
} else if (a <= -5.6e-270) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 3.5e-30) {
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 (a <= (-7.3d-28)) then
tmp = a * 120.0d0
else if (a <= (-5.6d-270)) then
tmp = 60.0d0 * ((x - y) / z)
else if (a <= 3.5d-30) 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 (a <= -7.3e-28) {
tmp = a * 120.0;
} else if (a <= -5.6e-270) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 3.5e-30) {
tmp = -60.0 * ((x - y) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.3e-28: tmp = a * 120.0 elif a <= -5.6e-270: tmp = 60.0 * ((x - y) / z) elif a <= 3.5e-30: tmp = -60.0 * ((x - y) / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.3e-28) tmp = Float64(a * 120.0); elseif (a <= -5.6e-270) tmp = Float64(60.0 * Float64(Float64(x - y) / z)); elseif (a <= 3.5e-30) 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 (a <= -7.3e-28) tmp = a * 120.0; elseif (a <= -5.6e-270) tmp = 60.0 * ((x - y) / z); elseif (a <= 3.5e-30) tmp = -60.0 * ((x - y) / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.3e-28], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -5.6e-270], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-30], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.3 \cdot 10^{-28}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -5.6 \cdot 10^{-270}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-30}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -7.2999999999999996e-28 or 3.5000000000000003e-30 < a Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 82.4%
if -7.2999999999999996e-28 < a < -5.5999999999999999e-270Initial program 99.6%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in a around 0 81.9%
Taylor expanded in z around inf 49.1%
if -5.5999999999999999e-270 < a < 3.5000000000000003e-30Initial program 99.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 77.0%
Taylor expanded in z around 0 53.8%
Final simplification68.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.3e-28)
(* a 120.0)
(if (<= a -5.5e-270)
(* 60.0 (/ (- x y) z))
(if (<= a 1.2e-29) (/ -60.0 (/ t (- x y))) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.3e-28) {
tmp = a * 120.0;
} else if (a <= -5.5e-270) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 1.2e-29) {
tmp = -60.0 / (t / (x - y));
} 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 <= (-7.3d-28)) then
tmp = a * 120.0d0
else if (a <= (-5.5d-270)) then
tmp = 60.0d0 * ((x - y) / z)
else if (a <= 1.2d-29) then
tmp = (-60.0d0) / (t / (x - y))
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 <= -7.3e-28) {
tmp = a * 120.0;
} else if (a <= -5.5e-270) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 1.2e-29) {
tmp = -60.0 / (t / (x - y));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.3e-28: tmp = a * 120.0 elif a <= -5.5e-270: tmp = 60.0 * ((x - y) / z) elif a <= 1.2e-29: tmp = -60.0 / (t / (x - y)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.3e-28) tmp = Float64(a * 120.0); elseif (a <= -5.5e-270) tmp = Float64(60.0 * Float64(Float64(x - y) / z)); elseif (a <= 1.2e-29) tmp = Float64(-60.0 / Float64(t / Float64(x - y))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.3e-28) tmp = a * 120.0; elseif (a <= -5.5e-270) tmp = 60.0 * ((x - y) / z); elseif (a <= 1.2e-29) tmp = -60.0 / (t / (x - y)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.3e-28], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -5.5e-270], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-29], N[(-60.0 / N[(t / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.3 \cdot 10^{-28}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -5.5 \cdot 10^{-270}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{-60}{\frac{t}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -7.2999999999999996e-28 or 1.19999999999999996e-29 < a Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 82.4%
if -7.2999999999999996e-28 < a < -5.4999999999999996e-270Initial program 99.6%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in a around 0 81.9%
Taylor expanded in z around inf 49.1%
if -5.4999999999999996e-270 < a < 1.19999999999999996e-29Initial program 99.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 77.0%
Taylor expanded in z around 0 53.8%
clear-num53.8%
un-div-inv53.8%
Applied egg-rr53.8%
Final simplification68.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.7e+159) (not (<= x 7.5e-16))) (+ (* x (/ 60.0 (- z t))) (* a 120.0)) (+ (* y (/ 60.0 (- t z))) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.7e+159) || !(x <= 7.5e-16)) {
tmp = (x * (60.0 / (z - t))) + (a * 120.0);
} else {
tmp = (y * (60.0 / (t - z))) + (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.7d+159)) .or. (.not. (x <= 7.5d-16))) then
tmp = (x * (60.0d0 / (z - t))) + (a * 120.0d0)
else
tmp = (y * (60.0d0 / (t - z))) + (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.7e+159) || !(x <= 7.5e-16)) {
tmp = (x * (60.0 / (z - t))) + (a * 120.0);
} else {
tmp = (y * (60.0 / (t - z))) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -2.7e+159) or not (x <= 7.5e-16): tmp = (x * (60.0 / (z - t))) + (a * 120.0) else: tmp = (y * (60.0 / (t - z))) + (a * 120.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.7e+159) || !(x <= 7.5e-16)) tmp = Float64(Float64(x * Float64(60.0 / Float64(z - t))) + Float64(a * 120.0)); else tmp = Float64(Float64(y * Float64(60.0 / Float64(t - z))) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -2.7e+159) || ~((x <= 7.5e-16))) tmp = (x * (60.0 / (z - t))) + (a * 120.0); else tmp = (y * (60.0 / (t - z))) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.7e+159], N[Not[LessEqual[x, 7.5e-16]], $MachinePrecision]], N[(N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+159} \lor \neg \left(x \leq 7.5 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot \frac{60}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{60}{t - z} + a \cdot 120\\
\end{array}
\end{array}
if x < -2.70000000000000008e159 or 7.5e-16 < x Initial program 98.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 89.8%
associate-*r/88.8%
*-commutative88.8%
associate-*r/89.9%
Simplified89.9%
if -2.70000000000000008e159 < x < 7.5e-16Initial program 99.9%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 95.0%
associate-*r/95.0%
neg-mul-195.0%
Simplified95.0%
Taylor expanded in y around 0 94.9%
associate-*r/95.0%
*-commutative95.0%
associate-*r/95.0%
Simplified95.0%
Final simplification93.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.65e+159) (not (<= x 9e-17))) (+ (* x (/ 60.0 (- z t))) (* a 120.0)) (+ (/ (* y -60.0) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.65e+159) || !(x <= 9e-17)) {
tmp = (x * (60.0 / (z - t))) + (a * 120.0);
} else {
tmp = ((y * -60.0) / (z - t)) + (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.65d+159)) .or. (.not. (x <= 9d-17))) then
tmp = (x * (60.0d0 / (z - t))) + (a * 120.0d0)
else
tmp = ((y * (-60.0d0)) / (z - t)) + (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.65e+159) || !(x <= 9e-17)) {
tmp = (x * (60.0 / (z - t))) + (a * 120.0);
} else {
tmp = ((y * -60.0) / (z - t)) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -2.65e+159) or not (x <= 9e-17): tmp = (x * (60.0 / (z - t))) + (a * 120.0) else: tmp = ((y * -60.0) / (z - t)) + (a * 120.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.65e+159) || !(x <= 9e-17)) tmp = Float64(Float64(x * Float64(60.0 / Float64(z - t))) + Float64(a * 120.0)); else tmp = Float64(Float64(Float64(y * -60.0) / Float64(z - t)) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -2.65e+159) || ~((x <= 9e-17))) tmp = (x * (60.0 / (z - t))) + (a * 120.0); else tmp = ((y * -60.0) / (z - t)) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.65e+159], N[Not[LessEqual[x, 9e-17]], $MachinePrecision]], N[(N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{+159} \lor \neg \left(x \leq 9 \cdot 10^{-17}\right):\\
\;\;\;\;x \cdot \frac{60}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\
\end{array}
\end{array}
if x < -2.6499999999999999e159 or 8.99999999999999957e-17 < x Initial program 98.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 89.8%
associate-*r/88.8%
*-commutative88.8%
associate-*r/89.9%
Simplified89.9%
if -2.6499999999999999e159 < x < 8.99999999999999957e-17Initial program 99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 94.9%
associate-*r/95.0%
Simplified95.0%
Final simplification93.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.2e-63) (not (<= a 7.4e-32))) (* a 120.0) (* -60.0 (/ (- x y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.2e-63) || !(a <= 7.4e-32)) {
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 <= (-9.2d-63)) .or. (.not. (a <= 7.4d-32))) 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 <= -9.2e-63) || !(a <= 7.4e-32)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * ((x - y) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.2e-63) or not (a <= 7.4e-32): 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 <= -9.2e-63) || !(a <= 7.4e-32)) 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 <= -9.2e-63) || ~((a <= 7.4e-32))) 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, -9.2e-63], N[Not[LessEqual[a, 7.4e-32]], $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 -9.2 \cdot 10^{-63} \lor \neg \left(a \leq 7.4 \cdot 10^{-32}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if a < -9.2e-63 or 7.4e-32 < a Initial program 99.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 78.5%
if -9.2e-63 < a < 7.4e-32Initial program 99.7%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 79.3%
Taylor expanded in z around 0 47.7%
Final simplification65.5%
(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(60.0 * Float64(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[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
60 \cdot \frac{x - y}{z - t} + a \cdot 120
\end{array}
Initial program 99.5%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(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.5%
*-commutative99.5%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.05e+214) (* -60.0 (/ x t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.05e+214) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-2.05d+214)) then
tmp = (-60.0d0) * (x / t)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.05e+214) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.05e+214: tmp = -60.0 * (x / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.05e+214) tmp = Float64(-60.0 * Float64(x / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.05e+214) tmp = -60.0 * (x / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.05e+214], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+214}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -2.05e214Initial program 99.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 83.2%
Taylor expanded in z around 0 57.0%
Taylor expanded in x around inf 51.5%
if -2.05e214 < x Initial program 99.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 57.7%
Final simplification57.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.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 55.0%
Final simplification55.0%
(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 2024059
(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)))