
(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 (+ (* 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.8%
associate-/l*99.9%
Simplified99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -2e-130) (not (<= (* a 120.0) 1e-158))) (+ (* a 120.0) (* 60.0 (/ y (- t z)))) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 120.0) <= -2e-130) || !((a * 120.0) <= 1e-158)) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} 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) <= (-2d-130)) .or. (.not. ((a * 120.0d0) <= 1d-158))) then
tmp = (a * 120.0d0) + (60.0d0 * (y / (t - z)))
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) <= -2e-130) || !((a * 120.0) <= 1e-158)) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a * 120.0) <= -2e-130) or not ((a * 120.0) <= 1e-158): tmp = (a * 120.0) + (60.0 * (y / (t - z))) 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) <= -2e-130) || !(Float64(a * 120.0) <= 1e-158)) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / Float64(t - z)))); 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) <= -2e-130) || ~(((a * 120.0) <= 1e-158))) tmp = (a * 120.0) + (60.0 * (y / (t - z))); 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], -2e-130], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-158]], $MachinePrecision]], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -2 \cdot 10^{-130} \lor \neg \left(a \cdot 120 \leq 10^{-158}\right):\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -2.0000000000000002e-130 or 1.00000000000000006e-158 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 85.5%
associate-*r/85.5%
remove-double-neg85.5%
neg-mul-185.5%
times-frac85.5%
metadata-eval85.5%
neg-sub085.5%
sub-neg85.5%
+-commutative85.5%
associate--r+85.5%
neg-sub085.5%
remove-double-neg85.5%
Simplified85.5%
if -2.0000000000000002e-130 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000006e-158Initial program 99.5%
associate-/l*99.8%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 91.7%
Final simplification86.9%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -2e-130)
(+ (* a 120.0) (/ (* y -60.0) (- z t)))
(if (<= (* a 120.0) 1e-158)
(* 60.0 (/ (- x y) (- z t)))
(+ (* a 120.0) (* 60.0 (/ y (- t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -2e-130) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else if ((a * 120.0) <= 1e-158) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = (a * 120.0) + (60.0 * (y / (t - 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 ((a * 120.0d0) <= (-2d-130)) then
tmp = (a * 120.0d0) + ((y * (-60.0d0)) / (z - t))
else if ((a * 120.0d0) <= 1d-158) then
tmp = 60.0d0 * ((x - y) / (z - t))
else
tmp = (a * 120.0d0) + (60.0d0 * (y / (t - z)))
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) <= -2e-130) {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
} else if ((a * 120.0) <= 1e-158) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -2e-130: tmp = (a * 120.0) + ((y * -60.0) / (z - t)) elif (a * 120.0) <= 1e-158: tmp = 60.0 * ((x - y) / (z - t)) else: tmp = (a * 120.0) + (60.0 * (y / (t - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -2e-130) tmp = Float64(Float64(a * 120.0) + Float64(Float64(y * -60.0) / Float64(z - t))); elseif (Float64(a * 120.0) <= 1e-158) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -2e-130) tmp = (a * 120.0) + ((y * -60.0) / (z - t)); elseif ((a * 120.0) <= 1e-158) tmp = 60.0 * ((x - y) / (z - t)); else tmp = (a * 120.0) + (60.0 * (y / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -2e-130], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 1e-158], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -2 \cdot 10^{-130}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\mathbf{elif}\;a \cdot 120 \leq 10^{-158}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -2.0000000000000002e-130Initial program 99.9%
Taylor expanded in x around 0 84.4%
if -2.0000000000000002e-130 < (*.f64 a #s(literal 120 binary64)) < 1.00000000000000006e-158Initial program 99.5%
associate-/l*99.8%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 91.7%
if 1.00000000000000006e-158 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 86.5%
associate-*r/86.4%
remove-double-neg86.4%
neg-mul-186.4%
times-frac86.5%
metadata-eval86.5%
neg-sub086.5%
sub-neg86.5%
+-commutative86.5%
associate--r+86.5%
neg-sub086.5%
remove-double-neg86.5%
Simplified86.5%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= (* a 120.0) -5e-46) (not (<= (* a 120.0) 50.0))) (+ (* 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) <= -5e-46) || !((a * 120.0) <= 50.0)) {
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) <= (-5d-46)) .or. (.not. ((a * 120.0d0) <= 50.0d0))) 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) <= -5e-46) || !((a * 120.0) <= 50.0)) {
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) <= -5e-46) or not ((a * 120.0) <= 50.0): 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) <= -5e-46) || !(Float64(a * 120.0) <= 50.0)) 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) <= -5e-46) || ~(((a * 120.0) <= 50.0))) 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], -5e-46], N[Not[LessEqual[N[(a * 120.0), $MachinePrecision], 50.0]], $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 -5 \cdot 10^{-46} \lor \neg \left(a \cdot 120 \leq 50\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 #s(literal 120 binary64)) < -4.99999999999999992e-46 or 50 < (*.f64 a #s(literal 120 binary64)) Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 85.9%
associate-*r/85.9%
Simplified85.9%
Taylor expanded in z around 0 76.6%
if -4.99999999999999992e-46 < (*.f64 a #s(literal 120 binary64)) < 50Initial program 99.7%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 74.8%
Final simplification75.8%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1e-22)
(+ (* a 120.0) (* 60.0 (/ y (- t z))))
(if (<= y 7.5e+70)
(+ (* a 120.0) (/ (* 60.0 x) (- z t)))
(+ (* a 120.0) (/ (* y -60.0) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1e-22) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} else if (y <= 7.5e+70) {
tmp = (a * 120.0) + ((60.0 * x) / (z - t));
} 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 (y <= (-1d-22)) then
tmp = (a * 120.0d0) + (60.0d0 * (y / (t - z)))
else if (y <= 7.5d+70) then
tmp = (a * 120.0d0) + ((60.0d0 * x) / (z - t))
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 (y <= -1e-22) {
tmp = (a * 120.0) + (60.0 * (y / (t - z)));
} else if (y <= 7.5e+70) {
tmp = (a * 120.0) + ((60.0 * x) / (z - t));
} else {
tmp = (a * 120.0) + ((y * -60.0) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1e-22: tmp = (a * 120.0) + (60.0 * (y / (t - z))) elif y <= 7.5e+70: tmp = (a * 120.0) + ((60.0 * x) / (z - t)) else: tmp = (a * 120.0) + ((y * -60.0) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1e-22) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(y / Float64(t - z)))); elseif (y <= 7.5e+70) tmp = Float64(Float64(a * 120.0) + Float64(Float64(60.0 * x) / Float64(z - t))); 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 (y <= -1e-22) tmp = (a * 120.0) + (60.0 * (y / (t - z))); elseif (y <= 7.5e+70) tmp = (a * 120.0) + ((60.0 * x) / (z - t)); else tmp = (a * 120.0) + ((y * -60.0) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1e-22], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+70], N[(N[(a * 120.0), $MachinePrecision] + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $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}\;y \leq -1 \cdot 10^{-22}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{y}{t - z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+70}:\\
\;\;\;\;a \cdot 120 + \frac{60 \cdot x}{z - t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120 + \frac{y \cdot -60}{z - t}\\
\end{array}
\end{array}
if y < -1e-22Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 87.9%
associate-*r/87.9%
remove-double-neg87.9%
neg-mul-187.9%
times-frac87.9%
metadata-eval87.9%
neg-sub087.9%
sub-neg87.9%
+-commutative87.9%
associate--r+87.9%
neg-sub087.9%
remove-double-neg87.9%
Simplified87.9%
if -1e-22 < y < 7.50000000000000031e70Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 95.7%
associate-*r/95.6%
Simplified95.6%
if 7.50000000000000031e70 < y Initial program 99.8%
Taylor expanded in x around 0 91.7%
Final simplification93.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.4e-49) (not (<= a 15.0))) (* 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 <= -3.4e-49) || !(a <= 15.0)) {
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 <= (-3.4d-49)) .or. (.not. (a <= 15.0d0))) 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 <= -3.4e-49) || !(a <= 15.0)) {
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 <= -3.4e-49) or not (a <= 15.0): 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 <= -3.4e-49) || !(a <= 15.0)) 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 <= -3.4e-49) || ~((a <= 15.0))) 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, -3.4e-49], N[Not[LessEqual[a, 15.0]], $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 -3.4 \cdot 10^{-49} \lor \neg \left(a \leq 15\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if a < -3.40000000000000005e-49 or 15 < a Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 75.0%
if -3.40000000000000005e-49 < a < 15Initial program 99.7%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 75.0%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.5e-139) (not (<= a 4.2e-160))) (* a 120.0) (* x (/ 60.0 (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-139) || !(a <= 4.2e-160)) {
tmp = a * 120.0;
} else {
tmp = x * (60.0 / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-8.5d-139)) .or. (.not. (a <= 4.2d-160))) then
tmp = a * 120.0d0
else
tmp = x * (60.0d0 / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-139) || !(a <= 4.2e-160)) {
tmp = a * 120.0;
} else {
tmp = x * (60.0 / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.5e-139) or not (a <= 4.2e-160): tmp = a * 120.0 else: tmp = x * (60.0 / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.5e-139) || !(a <= 4.2e-160)) tmp = Float64(a * 120.0); else tmp = Float64(x * Float64(60.0 / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8.5e-139) || ~((a <= 4.2e-160))) tmp = a * 120.0; else tmp = x * (60.0 / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.5e-139], N[Not[LessEqual[a, 4.2e-160]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-139} \lor \neg \left(a \leq 4.2 \cdot 10^{-160}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if a < -8.5000000000000003e-139 or 4.2000000000000001e-160 < a Initial program 99.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 64.8%
if -8.5000000000000003e-139 < a < 4.2000000000000001e-160Initial program 99.5%
associate-/l*99.8%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 87.8%
Taylor expanded in x around inf 59.4%
Final simplification63.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9e+141) (not (<= y 4.4e+156))) (* 60.0 (/ y (- t z))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9e+141) || !(y <= 4.4e+156)) {
tmp = 60.0 * (y / (t - z));
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-9d+141)) .or. (.not. (y <= 4.4d+156))) then
tmp = 60.0d0 * (y / (t - z))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9e+141) || !(y <= 4.4e+156)) {
tmp = 60.0 * (y / (t - z));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9e+141) or not (y <= 4.4e+156): tmp = 60.0 * (y / (t - z)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9e+141) || !(y <= 4.4e+156)) tmp = Float64(60.0 * Float64(y / Float64(t - z))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9e+141) || ~((y <= 4.4e+156))) tmp = 60.0 * (y / (t - z)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9e+141], N[Not[LessEqual[y, 4.4e+156]], $MachinePrecision]], N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+141} \lor \neg \left(y \leq 4.4 \cdot 10^{+156}\right):\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -9.0000000000000003e141 or 4.40000000000000008e156 < y Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 94.0%
associate-*r/93.9%
remove-double-neg93.9%
neg-mul-193.9%
times-frac94.0%
metadata-eval94.0%
neg-sub094.0%
sub-neg94.0%
+-commutative94.0%
associate--r+94.0%
neg-sub094.0%
remove-double-neg94.0%
Simplified94.0%
Taylor expanded in y around inf 64.8%
if -9.0000000000000003e141 < y < 4.40000000000000008e156Initial program 99.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 59.5%
Final simplification60.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.05e+221) (not (<= y 4e+267))) (* -60.0 (/ y z)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.05e+221) || !(y <= 4e+267)) {
tmp = -60.0 * (y / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-3.05d+221)) .or. (.not. (y <= 4d+267))) then
tmp = (-60.0d0) * (y / z)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.05e+221) || !(y <= 4e+267)) {
tmp = -60.0 * (y / z);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.05e+221) or not (y <= 4e+267): tmp = -60.0 * (y / z) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.05e+221) || !(y <= 4e+267)) tmp = Float64(-60.0 * Float64(y / z)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.05e+221) || ~((y <= 4e+267))) tmp = -60.0 * (y / z); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.05e+221], N[Not[LessEqual[y, 4e+267]], $MachinePrecision]], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+221} \lor \neg \left(y \leq 4 \cdot 10^{+267}\right):\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if y < -3.0499999999999999e221 or 3.9999999999999999e267 < y Initial program 99.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 95.3%
associate-*r/95.2%
remove-double-neg95.2%
neg-mul-195.2%
times-frac95.3%
metadata-eval95.3%
neg-sub095.3%
sub-neg95.3%
+-commutative95.3%
associate--r+95.3%
neg-sub095.3%
remove-double-neg95.3%
Simplified95.3%
Taylor expanded in y around inf 86.1%
associate-*r/85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in t around 0 54.1%
if -3.0499999999999999e221 < y < 3.9999999999999999e267Initial program 99.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 56.2%
Final simplification56.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.12e+221) (* -60.0 (/ y z)) (if (<= y 3.2e+156) (* a 120.0) (* 60.0 (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.12e+221) {
tmp = -60.0 * (y / z);
} else if (y <= 3.2e+156) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (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 (y <= (-1.12d+221)) then
tmp = (-60.0d0) * (y / z)
else if (y <= 3.2d+156) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * (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 (y <= -1.12e+221) {
tmp = -60.0 * (y / z);
} else if (y <= 3.2e+156) {
tmp = a * 120.0;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.12e+221: tmp = -60.0 * (y / z) elif y <= 3.2e+156: tmp = a * 120.0 else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.12e+221) tmp = Float64(-60.0 * Float64(y / z)); elseif (y <= 3.2e+156) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.12e+221) tmp = -60.0 * (y / z); elseif (y <= 3.2e+156) tmp = a * 120.0; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.12e+221], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+156], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+221}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+156}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < -1.12e221Initial program 99.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 92.4%
associate-*r/92.3%
remove-double-neg92.3%
neg-mul-192.3%
times-frac92.4%
metadata-eval92.4%
neg-sub092.4%
sub-neg92.4%
+-commutative92.4%
associate--r+92.4%
neg-sub092.4%
remove-double-neg92.4%
Simplified92.4%
Taylor expanded in y around inf 77.5%
associate-*r/77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in t around 0 48.4%
if -1.12e221 < y < 3.20000000000000002e156Initial program 99.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 57.5%
if 3.20000000000000002e156 < y Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 92.9%
associate-*r/92.8%
remove-double-neg92.8%
neg-mul-192.8%
times-frac92.9%
metadata-eval92.9%
neg-sub092.9%
sub-neg92.9%
+-commutative92.9%
associate--r+92.9%
neg-sub092.9%
remove-double-neg92.9%
Simplified92.9%
Taylor expanded in y around inf 65.4%
associate-*r/65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in t around inf 48.2%
Final simplification56.0%
(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.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 52.5%
Final simplification52.5%
(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 2024132
(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)))