
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, (60.0 * ((x - y) / (z - t))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(60.0 * Float64(Float64(x - y) / Float64(z - t)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, 60 \cdot \frac{x - y}{z - t}\right)
\end{array}
Initial program 99.1%
associate-/l*99.5%
Simplified99.5%
+-commutative99.5%
fma-define99.9%
Applied egg-rr99.9%
(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 99.1%
associate-/l*99.5%
fma-define99.5%
Simplified99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -5e-26) (not (<= t_1 4e+14)))
(* 60.0 (/ (- x y) (- z t)))
(* a 120.0))))
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-26) || !(t_1 <= 4e+14)) {
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 = (60.0d0 * (x - y)) / (z - t)
if ((t_1 <= (-5d-26)) .or. (.not. (t_1 <= 4d+14))) 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 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -5e-26) || !(t_1 <= 4e+14)) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if (t_1 <= -5e-26) or not (t_1 <= 4e+14): 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(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -5e-26) || !(t_1 <= 4e+14)) 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 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if ((t_1 <= -5e-26) || ~((t_1 <= 4e+14))) 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[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-26], N[Not[LessEqual[t$95$1, 4e+14]], $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{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-26} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+14}\right):\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000019e-26 or 4e14 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.2%
associate-/l*99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in a around 0 77.9%
if -5.00000000000000019e-26 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4e14Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 81.2%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -5e+48) (not (<= x 3.5e+107))) (+ (* a 120.0) (/ x (* (- z t) 0.016666666666666666))) (+ (* a 120.0) (/ (* y -60.0) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5e+48) || !(x <= 3.5e+107)) {
tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666));
} else {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-5d+48)) .or. (.not. (x <= 3.5d+107))) then
tmp = (a * 120.0d0) + (x / ((z - t) * 0.016666666666666666d0))
else
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5e+48) || !(x <= 3.5e+107)) {
tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666));
} else {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -5e+48) or not (x <= 3.5e+107): tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666)) else: tmp = (a * 120.0) + ((y * -60.0) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -5e+48) || !(x <= 3.5e+107)) tmp = Float64(Float64(a * 120.0) + Float64(x / Float64(Float64(z - t) * 0.016666666666666666))); else tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -5e+48) || ~((x <= 3.5e+107))) tmp = (a * 120.0) + (x / ((z - t) * 0.016666666666666666)); else tmp = (a * 120.0) + ((y * -60.0) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -5e+48], N[Not[LessEqual[x, 3.5e+107]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(x / N[(N[(z - t), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+48} \lor \neg \left(x \leq 3.5 \cdot 10^{+107}\right):\\
\;\;\;\;a \cdot 120 + \frac{x}{\left(z - t\right) \cdot 0.016666666666666666}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\end{array}
\end{array}
if x < -4.99999999999999973e48 or 3.4999999999999997e107 < x Initial program 98.8%
associate-/l*98.8%
Simplified98.8%
+-commutative98.8%
fma-define99.9%
Applied egg-rr99.9%
*-commutative99.9%
associate-*l/99.8%
associate-*r/99.8%
fma-define98.8%
+-commutative98.8%
clear-num98.7%
un-div-inv98.8%
div-inv98.8%
metadata-eval98.8%
Applied egg-rr98.8%
Taylor expanded in x around inf 90.2%
if -4.99999999999999973e48 < x < 3.4999999999999997e107Initial program 99.2%
Taylor expanded in x around 0 92.5%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e-43) (not (<= z 1.05e-16))) (+ (* a 120.0) (* 60.0 (/ (- x y) z))) (+ (* a 120.0) (* (- x y) (/ -60.0 t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e-43) || !(z <= 1.05e-16)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + ((x - y) * (-60.0 / 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 ((z <= (-1.5d-43)) .or. (.not. (z <= 1.05d-16))) then
tmp = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
else
tmp = (a * 120.0d0) + ((x - y) * ((-60.0d0) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e-43) || !(z <= 1.05e-16)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) + ((x - y) * (-60.0 / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e-43) or not (z <= 1.05e-16): tmp = (a * 120.0) + (60.0 * ((x - y) / z)) else: tmp = (a * 120.0) + ((x - y) * (-60.0 / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e-43) || !(z <= 1.05e-16)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))); else tmp = Float64(Float64(a * 120.0) + Float64(Float64(x - y) * Float64(-60.0 / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.5e-43) || ~((z <= 1.05e-16))) tmp = (a * 120.0) + (60.0 * ((x - y) / z)); else tmp = (a * 120.0) + ((x - y) * (-60.0 / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e-43], N[Not[LessEqual[z, 1.05e-16]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-43} \lor \neg \left(z \leq 1.05 \cdot 10^{-16}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \left(x - y\right) \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if z < -1.50000000000000002e-43 or 1.0500000000000001e-16 < z Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 88.5%
if -1.50000000000000002e-43 < z < 1.0500000000000001e-16Initial program 98.9%
*-commutative98.9%
associate-/l*98.8%
Applied egg-rr98.8%
Taylor expanded in z around 0 93.2%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e-61) (not (<= z 0.0016))) (+ (* a 120.0) (* 60.0 (/ (- x y) z))) (- (* a 120.0) (/ (* 60.0 x) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e-61) || !(z <= 0.0016)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) - ((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 ((z <= (-3.5d-61)) .or. (.not. (z <= 0.0016d0))) then
tmp = (a * 120.0d0) + (60.0d0 * ((x - y) / z))
else
tmp = (a * 120.0d0) - ((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 ((z <= -3.5e-61) || !(z <= 0.0016)) {
tmp = (a * 120.0) + (60.0 * ((x - y) / z));
} else {
tmp = (a * 120.0) - ((60.0 * x) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e-61) or not (z <= 0.0016): tmp = (a * 120.0) + (60.0 * ((x - y) / z)) else: tmp = (a * 120.0) - ((60.0 * x) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e-61) || !(z <= 0.0016)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(Float64(x - y) / z))); else tmp = Float64(Float64(a * 120.0) - Float64(Float64(60.0 * x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e-61) || ~((z <= 0.0016))) tmp = (a * 120.0) + (60.0 * ((x - y) / z)); else tmp = (a * 120.0) - ((60.0 * x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e-61], N[Not[LessEqual[z, 0.0016]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] - N[(N[(60.0 * x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-61} \lor \neg \left(z \leq 0.0016\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 - \frac{60 \cdot x}{t}\\
\end{array}
\end{array}
if z < -3.5000000000000003e-61 or 0.00160000000000000008 < z Initial program 99.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 88.5%
if -3.5000000000000003e-61 < z < 0.00160000000000000008Initial program 98.9%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in x around inf 73.8%
associate-*r/73.9%
Simplified73.9%
Taylor expanded in z around 0 71.1%
neg-mul-171.1%
Simplified71.1%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -3.5e+140) (not (<= x 6.2e+133))) (* 60.0 (/ x (- z t))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -3.5e+140) || !(x <= 6.2e+133)) {
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 <= (-3.5d+140)) .or. (.not. (x <= 6.2d+133))) 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 <= -3.5e+140) || !(x <= 6.2e+133)) {
tmp = 60.0 * (x / (z - t));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -3.5e+140) or not (x <= 6.2e+133): 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 <= -3.5e+140) || !(x <= 6.2e+133)) 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 <= -3.5e+140) || ~((x <= 6.2e+133))) 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, -3.5e+140], N[Not[LessEqual[x, 6.2e+133]], $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 -3.5 \cdot 10^{+140} \lor \neg \left(x \leq 6.2 \cdot 10^{+133}\right):\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -3.49999999999999989e140 or 6.2e133 < x Initial program 98.3%
associate-/l*98.3%
Simplified98.3%
+-commutative98.3%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 75.1%
if -3.49999999999999989e140 < x < 6.2e133Initial program 99.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 66.1%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.5e+140) (* 60.0 (/ x (- z t))) (if (<= x 4e+133) (* a 120.0) (* x (/ 60.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.5e+140) {
tmp = 60.0 * (x / (z - t));
} else if (x <= 4e+133) {
tmp = a * 120.0;
} else {
tmp = x * (60.0 / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-2.5d+140)) then
tmp = 60.0d0 * (x / (z - t))
else if (x <= 4d+133) then
tmp = a * 120.0d0
else
tmp = x * (60.0d0 / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.5e+140) {
tmp = 60.0 * (x / (z - t));
} else if (x <= 4e+133) {
tmp = a * 120.0;
} else {
tmp = x * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.5e+140: tmp = 60.0 * (x / (z - t)) elif x <= 4e+133: tmp = a * 120.0 else: tmp = x * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.5e+140) tmp = Float64(60.0 * Float64(x / Float64(z - t))); elseif (x <= 4e+133) tmp = Float64(a * 120.0); else tmp = Float64(x * Float64(60.0 / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.5e+140) tmp = 60.0 * (x / (z - t)); elseif (x <= 4e+133) tmp = a * 120.0; else tmp = x * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.5e+140], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e+133], N[(a * 120.0), $MachinePrecision], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+140}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+133}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if x < -2.50000000000000004e140Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
+-commutative99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 72.6%
if -2.50000000000000004e140 < x < 4.0000000000000001e133Initial program 99.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 66.1%
if 4.0000000000000001e133 < x Initial program 96.8%
associate-/l*96.8%
Simplified96.8%
+-commutative96.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 77.7%
clear-num77.4%
un-div-inv77.7%
Applied egg-rr77.7%
associate-/r/77.7%
Simplified77.7%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -5.5e+136) (not (<= x 1.6e+134))) (* -60.0 (/ x t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5.5e+136) || !(x <= 1.6e+134)) {
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 <= (-5.5d+136)) .or. (.not. (x <= 1.6d+134))) 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 <= -5.5e+136) || !(x <= 1.6e+134)) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -5.5e+136) or not (x <= 1.6e+134): tmp = -60.0 * (x / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -5.5e+136) || !(x <= 1.6e+134)) 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 <= -5.5e+136) || ~((x <= 1.6e+134))) tmp = -60.0 * (x / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -5.5e+136], N[Not[LessEqual[x, 1.6e+134]], $MachinePrecision]], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+136} \lor \neg \left(x \leq 1.6 \cdot 10^{+134}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -5.50000000000000039e136 or 1.6e134 < x Initial program 98.4%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in x around inf 89.7%
associate-*r/89.7%
Simplified89.7%
Taylor expanded in z around 0 62.3%
Taylor expanded in x around inf 49.3%
if -5.50000000000000039e136 < x < 1.6e134Initial program 99.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 66.2%
Final simplification61.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.58e+134) (* -60.0 (/ x t)) (if (<= x 4.2e+133) (* a 120.0) (/ (* x -60.0) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.58e+134) {
tmp = -60.0 * (x / t);
} else if (x <= 4.2e+133) {
tmp = a * 120.0;
} else {
tmp = (x * -60.0) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-1.58d+134)) then
tmp = (-60.0d0) * (x / t)
else if (x <= 4.2d+133) then
tmp = a * 120.0d0
else
tmp = (x * (-60.0d0)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.58e+134) {
tmp = -60.0 * (x / t);
} else if (x <= 4.2e+133) {
tmp = a * 120.0;
} else {
tmp = (x * -60.0) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.58e+134: tmp = -60.0 * (x / t) elif x <= 4.2e+133: tmp = a * 120.0 else: tmp = (x * -60.0) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.58e+134) tmp = Float64(-60.0 * Float64(x / t)); elseif (x <= 4.2e+133) tmp = Float64(a * 120.0); else tmp = Float64(Float64(x * -60.0) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.58e+134) tmp = -60.0 * (x / t); elseif (x <= 4.2e+133) tmp = a * 120.0; else tmp = (x * -60.0) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.58e+134], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e+133], N[(a * 120.0), $MachinePrecision], N[(N[(x * -60.0), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.58 \cdot 10^{+134}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+133}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot -60}{t}\\
\end{array}
\end{array}
if x < -1.57999999999999994e134Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 88.6%
associate-*r/88.5%
Simplified88.5%
Taylor expanded in z around 0 63.1%
Taylor expanded in x around inf 47.6%
if -1.57999999999999994e134 < x < 4.2e133Initial program 99.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 66.2%
if 4.2e133 < x Initial program 96.8%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in x around inf 91.0%
associate-*r/91.0%
Simplified91.0%
Taylor expanded in z around 0 61.4%
Taylor expanded in x around inf 51.2%
associate-*r/51.2%
Applied egg-rr51.2%
Final simplification61.6%
(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.1%
associate-/l*99.5%
Simplified99.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.1%
associate-/l*99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in z around inf 53.2%
Final simplification53.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 2024138
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))