
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (* (- x y) (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) * (60.0 / (z - t))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) * Float64(60.0 / Float64(z - t)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \left(x - y\right) \cdot \frac{60}{z - t}\right)
\end{array}
Initial program 99.0%
+-commutative99.0%
fma-def99.1%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (or (<= t_1 -2e+143) (not (<= t_1 1e+28)))
(* 60.0 (/ (- x y) (- z t)))
(+ (/ 60.0 (/ (- z t) x)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if ((t_1 <= -2e+143) || !(t_1 <= 1e+28)) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = (60.0 / ((z - t) / x)) + (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) :: t_1
real(8) :: tmp
t_1 = ((x - y) * 60.0d0) / (z - t)
if ((t_1 <= (-2d+143)) .or. (.not. (t_1 <= 1d+28))) then
tmp = 60.0d0 * ((x - y) / (z - t))
else
tmp = (60.0d0 / ((z - t) / x)) + (a * 120.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if ((t_1 <= -2e+143) || !(t_1 <= 1e+28)) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = (60.0 / ((z - t) / x)) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if (t_1 <= -2e+143) or not (t_1 <= 1e+28): tmp = 60.0 * ((x - y) / (z - t)) else: tmp = (60.0 / ((z - t) / x)) + (a * 120.0) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -2e+143) || !(t_1 <= 1e+28)) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = Float64(Float64(60.0 / Float64(Float64(z - t) / x)) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if ((t_1 <= -2e+143) || ~((t_1 <= 1e+28))) tmp = 60.0 * ((x - y) / (z - t)); else tmp = (60.0 / ((z - t) / x)) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+143], N[Not[LessEqual[t$95$1, 1e+28]], $MachinePrecision]], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+143} \lor \neg \left(t_1 \leq 10^{+28}\right):\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x}} + a \cdot 120\\
\end{array}
\end{array}
if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -2e143 or 9.99999999999999958e27 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) Initial program 97.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 86.6%
if -2e143 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 9.99999999999999958e27Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 88.9%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- x y) 60.0) (- z t))))
(if (or (<= t_1 -0.0002) (not (<= t_1 1e+16)))
(* 60.0 (/ (- x y) (- z t)))
(* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if ((t_1 <= -0.0002) || !(t_1 <= 1e+16)) {
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) :: t_1
real(8) :: tmp
t_1 = ((x - y) * 60.0d0) / (z - t)
if ((t_1 <= (-0.0002d0)) .or. (.not. (t_1 <= 1d+16))) 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 t_1 = ((x - y) * 60.0) / (z - t);
double tmp;
if ((t_1 <= -0.0002) || !(t_1 <= 1e+16)) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / (z - t) tmp = 0 if (t_1 <= -0.0002) or not (t_1 <= 1e+16): tmp = 60.0 * ((x - y) / (z - t)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -0.0002) || !(t_1 <= 1e+16)) 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) t_1 = ((x - y) * 60.0) / (z - t); tmp = 0.0; if ((t_1 <= -0.0002) || ~((t_1 <= 1e+16))) tmp = 60.0 * ((x - y) / (z - t)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -0.0002], N[Not[LessEqual[t$95$1, 1e+16]], $MachinePrecision]], 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}
t_1 := \frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{if}\;t_1 \leq -0.0002 \lor \neg \left(t_1 \leq 10^{+16}\right):\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < -2.0000000000000001e-4 or 1e16 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) Initial program 98.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 82.3%
if -2.0000000000000001e-4 < (/.f64 (*.f64 60 (-.f64 x y)) (-.f64 z t)) < 1e16Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.7%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(if (<= (- z t) -2e+159)
(* a 120.0)
(if (or (<= (- z t) -1e+108)
(and (not (<= (- z t) -5e+66)) (<= (- z t) 5e+110)))
(* -60.0 (/ (- x y) t))
(* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z - t) <= -2e+159) {
tmp = a * 120.0;
} else if (((z - t) <= -1e+108) || (!((z - t) <= -5e+66) && ((z - t) <= 5e+110))) {
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 ((z - t) <= (-2d+159)) then
tmp = a * 120.0d0
else if (((z - t) <= (-1d+108)) .or. (.not. ((z - t) <= (-5d+66))) .and. ((z - t) <= 5d+110)) 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 ((z - t) <= -2e+159) {
tmp = a * 120.0;
} else if (((z - t) <= -1e+108) || (!((z - t) <= -5e+66) && ((z - t) <= 5e+110))) {
tmp = -60.0 * ((x - y) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z - t) <= -2e+159: tmp = a * 120.0 elif ((z - t) <= -1e+108) or (not ((z - t) <= -5e+66) and ((z - t) <= 5e+110)): tmp = -60.0 * ((x - y) / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(z - t) <= -2e+159) tmp = Float64(a * 120.0); elseif ((Float64(z - t) <= -1e+108) || (!(Float64(z - t) <= -5e+66) && (Float64(z - t) <= 5e+110))) 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 ((z - t) <= -2e+159) tmp = a * 120.0; elseif (((z - t) <= -1e+108) || (~(((z - t) <= -5e+66)) && ((z - t) <= 5e+110))) tmp = -60.0 * ((x - y) / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z - t), $MachinePrecision], -2e+159], N[(a * 120.0), $MachinePrecision], If[Or[LessEqual[N[(z - t), $MachinePrecision], -1e+108], And[N[Not[LessEqual[N[(z - t), $MachinePrecision], -5e+66]], $MachinePrecision], LessEqual[N[(z - t), $MachinePrecision], 5e+110]]], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -2 \cdot 10^{+159}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;z - t \leq -1 \cdot 10^{+108} \lor \neg \left(z - t \leq -5 \cdot 10^{+66}\right) \land z - t \leq 5 \cdot 10^{+110}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (-.f64 z t) < -1.9999999999999999e159 or -1e108 < (-.f64 z t) < -4.99999999999999991e66 or 4.99999999999999978e110 < (-.f64 z t) Initial program 99.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.5%
if -1.9999999999999999e159 < (-.f64 z t) < -1e108 or -4.99999999999999991e66 < (-.f64 z t) < 4.99999999999999978e110Initial program 99.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 81.7%
Taylor expanded in z around 0 58.9%
Final simplification67.3%
(FPCore (x y z t a)
:precision binary64
(if (<= (- z t) -2e+159)
(* a 120.0)
(if (<= (- z t) -1e+108)
(/ (* (- x y) -60.0) t)
(if (<= (- z t) -5e+66)
(* a 120.0)
(if (<= (- z t) 5e+110) (* -60.0 (/ (- x y) t)) (* a 120.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z - t) <= -2e+159) {
tmp = a * 120.0;
} else if ((z - t) <= -1e+108) {
tmp = ((x - y) * -60.0) / t;
} else if ((z - t) <= -5e+66) {
tmp = a * 120.0;
} else if ((z - t) <= 5e+110) {
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 ((z - t) <= (-2d+159)) then
tmp = a * 120.0d0
else if ((z - t) <= (-1d+108)) then
tmp = ((x - y) * (-60.0d0)) / t
else if ((z - t) <= (-5d+66)) then
tmp = a * 120.0d0
else if ((z - t) <= 5d+110) 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 ((z - t) <= -2e+159) {
tmp = a * 120.0;
} else if ((z - t) <= -1e+108) {
tmp = ((x - y) * -60.0) / t;
} else if ((z - t) <= -5e+66) {
tmp = a * 120.0;
} else if ((z - t) <= 5e+110) {
tmp = -60.0 * ((x - y) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z - t) <= -2e+159: tmp = a * 120.0 elif (z - t) <= -1e+108: tmp = ((x - y) * -60.0) / t elif (z - t) <= -5e+66: tmp = a * 120.0 elif (z - t) <= 5e+110: tmp = -60.0 * ((x - y) / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(z - t) <= -2e+159) tmp = Float64(a * 120.0); elseif (Float64(z - t) <= -1e+108) tmp = Float64(Float64(Float64(x - y) * -60.0) / t); elseif (Float64(z - t) <= -5e+66) tmp = Float64(a * 120.0); elseif (Float64(z - t) <= 5e+110) 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 ((z - t) <= -2e+159) tmp = a * 120.0; elseif ((z - t) <= -1e+108) tmp = ((x - y) * -60.0) / t; elseif ((z - t) <= -5e+66) tmp = a * 120.0; elseif ((z - t) <= 5e+110) tmp = -60.0 * ((x - y) / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z - t), $MachinePrecision], -2e+159], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(z - t), $MachinePrecision], -1e+108], N[(N[(N[(x - y), $MachinePrecision] * -60.0), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z - t), $MachinePrecision], -5e+66], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(z - t), $MachinePrecision], 5e+110], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z - t \leq -2 \cdot 10^{+159}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;z - t \leq -1 \cdot 10^{+108}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot -60}{t}\\
\mathbf{elif}\;z - t \leq -5 \cdot 10^{+66}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;z - t \leq 5 \cdot 10^{+110}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (-.f64 z t) < -1.9999999999999999e159 or -1e108 < (-.f64 z t) < -4.99999999999999991e66 or 4.99999999999999978e110 < (-.f64 z t) Initial program 99.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 75.5%
if -1.9999999999999999e159 < (-.f64 z t) < -1e108Initial program 99.8%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 87.4%
Taylor expanded in z around 0 63.8%
associate-*r/63.9%
Applied egg-rr63.9%
if -4.99999999999999991e66 < (-.f64 z t) < 4.99999999999999978e110Initial program 98.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 80.8%
Taylor expanded in z around 0 58.2%
Final simplification67.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.05e+101) (not (<= y 9.5e+76))) (+ (/ (* y -60.0) (- z t)) (* a 120.0)) (+ (/ 60.0 (/ (- z t) x)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.05e+101) || !(y <= 9.5e+76)) {
tmp = ((y * -60.0) / (z - t)) + (a * 120.0);
} else {
tmp = (60.0 / ((z - t) / x)) + (a * 120.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.05d+101)) .or. (.not. (y <= 9.5d+76))) then
tmp = ((y * (-60.0d0)) / (z - t)) + (a * 120.0d0)
else
tmp = (60.0d0 / ((z - t) / x)) + (a * 120.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.05e+101) || !(y <= 9.5e+76)) {
tmp = ((y * -60.0) / (z - t)) + (a * 120.0);
} else {
tmp = (60.0 / ((z - t) / x)) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.05e+101) or not (y <= 9.5e+76): tmp = ((y * -60.0) / (z - t)) + (a * 120.0) else: tmp = (60.0 / ((z - t) / x)) + (a * 120.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.05e+101) || !(y <= 9.5e+76)) tmp = Float64(Float64(Float64(y * -60.0) / Float64(z - t)) + Float64(a * 120.0)); else tmp = Float64(Float64(60.0 / Float64(Float64(z - t) / x)) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.05e+101) || ~((y <= 9.5e+76))) tmp = ((y * -60.0) / (z - t)) + (a * 120.0); else tmp = (60.0 / ((z - t) / x)) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.05e+101], N[Not[LessEqual[y, 9.5e+76]], $MachinePrecision]], N[(N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+101} \lor \neg \left(y \leq 9.5 \cdot 10^{+76}\right):\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x}} + a \cdot 120\\
\end{array}
\end{array}
if y < -1.05e101 or 9.5000000000000003e76 < y Initial program 99.8%
Taylor expanded in x around 0 87.8%
if -1.05e101 < y < 9.5000000000000003e76Initial program 98.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 91.0%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
Initial program 99.0%
associate-/l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.6e-63)
(* a 120.0)
(if (<= a -8.5e-226)
(* 60.0 (/ y t))
(if (<= a 6.5e-61) (* -60.0 (/ x t)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.6e-63) {
tmp = a * 120.0;
} else if (a <= -8.5e-226) {
tmp = 60.0 * (y / t);
} else if (a <= 6.5e-61) {
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 (a <= (-1.6d-63)) then
tmp = a * 120.0d0
else if (a <= (-8.5d-226)) then
tmp = 60.0d0 * (y / t)
else if (a <= 6.5d-61) 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 (a <= -1.6e-63) {
tmp = a * 120.0;
} else if (a <= -8.5e-226) {
tmp = 60.0 * (y / t);
} else if (a <= 6.5e-61) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.6e-63: tmp = a * 120.0 elif a <= -8.5e-226: tmp = 60.0 * (y / t) elif a <= 6.5e-61: tmp = -60.0 * (x / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.6e-63) tmp = Float64(a * 120.0); elseif (a <= -8.5e-226) tmp = Float64(60.0 * Float64(y / t)); elseif (a <= 6.5e-61) 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 (a <= -1.6e-63) tmp = a * 120.0; elseif (a <= -8.5e-226) tmp = 60.0 * (y / t); elseif (a <= 6.5e-61) tmp = -60.0 * (x / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.6e-63], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -8.5e-226], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e-61], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{-63}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -8.5 \cdot 10^{-226}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-61}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -1.59999999999999994e-63 or 6.4999999999999994e-61 < a Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 66.3%
if -1.59999999999999994e-63 < a < -8.4999999999999998e-226Initial program 99.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in a around 0 90.5%
Taylor expanded in z around 0 65.8%
Taylor expanded in x around 0 47.1%
if -8.4999999999999998e-226 < a < 6.4999999999999994e-61Initial program 98.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 88.2%
Taylor expanded in z around 0 58.0%
Taylor expanded in x around inf 41.1%
Final simplification58.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.5e-64)
(* a 120.0)
(if (<= a -1.9e-225)
(* 60.0 (/ y t))
(if (<= a 7.2e-68) (/ -60.0 (/ t x)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.5e-64) {
tmp = a * 120.0;
} else if (a <= -1.9e-225) {
tmp = 60.0 * (y / t);
} else if (a <= 7.2e-68) {
tmp = -60.0 / (t / x);
} 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.5d-64)) then
tmp = a * 120.0d0
else if (a <= (-1.9d-225)) then
tmp = 60.0d0 * (y / t)
else if (a <= 7.2d-68) then
tmp = (-60.0d0) / (t / x)
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.5e-64) {
tmp = a * 120.0;
} else if (a <= -1.9e-225) {
tmp = 60.0 * (y / t);
} else if (a <= 7.2e-68) {
tmp = -60.0 / (t / x);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.5e-64: tmp = a * 120.0 elif a <= -1.9e-225: tmp = 60.0 * (y / t) elif a <= 7.2e-68: tmp = -60.0 / (t / x) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.5e-64) tmp = Float64(a * 120.0); elseif (a <= -1.9e-225) tmp = Float64(60.0 * Float64(y / t)); elseif (a <= 7.2e-68) tmp = Float64(-60.0 / Float64(t / x)); 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.5e-64) tmp = a * 120.0; elseif (a <= -1.9e-225) tmp = 60.0 * (y / t); elseif (a <= 7.2e-68) tmp = -60.0 / (t / x); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.5e-64], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -1.9e-225], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-68], N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{-64}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-225}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-68}:\\
\;\;\;\;\frac{-60}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -7.49999999999999949e-64 or 7.20000000000000015e-68 < a Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 66.3%
if -7.49999999999999949e-64 < a < -1.9000000000000001e-225Initial program 99.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in a around 0 90.5%
Taylor expanded in z around 0 65.8%
Taylor expanded in x around 0 47.1%
if -1.9000000000000001e-225 < a < 7.20000000000000015e-68Initial program 98.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 88.2%
Taylor expanded in z around 0 58.0%
Taylor expanded in x around inf 41.1%
associate-*r/41.2%
associate-/l*41.2%
Simplified41.2%
Final simplification58.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e-8) (not (<= a 2.3e-65))) (* a 120.0) (* -60.0 (/ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e-8) || !(a <= 2.3e-65)) {
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 <= (-2d-8)) .or. (.not. (a <= 2.3d-65))) 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 <= -2e-8) || !(a <= 2.3e-65)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e-8) or not (a <= 2.3e-65): tmp = a * 120.0 else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e-8) || !(a <= 2.3e-65)) 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 <= -2e-8) || ~((a <= 2.3e-65))) 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, -2e-8], N[Not[LessEqual[a, 2.3e-65]], $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 \cdot 10^{-8} \lor \neg \left(a \leq 2.3 \cdot 10^{-65}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if a < -2e-8 or 2.3e-65 < a Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 70.5%
if -2e-8 < a < 2.3e-65Initial program 98.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 87.0%
Taylor expanded in z around 0 56.8%
Taylor expanded in x around inf 33.4%
Final simplification55.5%
(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 47.8%
Final simplification47.8%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
herbie shell --seed 2023280
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:herbie-target
(+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))