
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.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) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.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) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (/ a y))))
(if (<= (* a 2.0) -1e+162)
(fma 0.5 t_1 (/ t (/ (/ a z) -4.5)))
(if (<= (* a 2.0) 5e+28)
(/ (- (* x y) (* t (* z 9.0))) (* a 2.0))
(fma 0.5 t_1 (* -4.5 (* z (/ t a))))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (a / y);
double tmp;
if ((a * 2.0) <= -1e+162) {
tmp = fma(0.5, t_1, (t / ((a / z) / -4.5)));
} else if ((a * 2.0) <= 5e+28) {
tmp = ((x * y) - (t * (z * 9.0))) / (a * 2.0);
} else {
tmp = fma(0.5, t_1, (-4.5 * (z * (t / a))));
}
return tmp;
}
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(x / Float64(a / y)) tmp = 0.0 if (Float64(a * 2.0) <= -1e+162) tmp = fma(0.5, t_1, Float64(t / Float64(Float64(a / z) / -4.5))); elseif (Float64(a * 2.0) <= 5e+28) tmp = Float64(Float64(Float64(x * y) - Float64(t * Float64(z * 9.0))) / Float64(a * 2.0)); else tmp = fma(0.5, t_1, Float64(-4.5 * Float64(z * Float64(t / a)))); end return tmp end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 2.0), $MachinePrecision], -1e+162], N[(0.5 * t$95$1 + N[(t / N[(N[(a / z), $MachinePrecision] / -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 2.0), $MachinePrecision], 5e+28], N[(N[(N[(x * y), $MachinePrecision] - N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * t$95$1 + N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{a}{y}}\\
\mathbf{if}\;a \cdot 2 \leq -1 \cdot 10^{+162}:\\
\;\;\;\;\mathsf{fma}\left(0.5, t_1, \frac{t}{\frac{\frac{a}{z}}{-4.5}}\right)\\
\mathbf{elif}\;a \cdot 2 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{x \cdot y - t \cdot \left(z \cdot 9\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, t_1, -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\right)\\
\end{array}
\end{array}
if (*.f64 a 2) < -9.9999999999999994e161Initial program 74.7%
*-commutative74.7%
*-commutative74.7%
associate-*l*74.8%
Simplified74.8%
Taylor expanded in x around 0 74.8%
+-commutative74.8%
fma-def74.8%
associate-/l*79.3%
associate-/l*98.9%
associate-/r/84.2%
Simplified84.2%
associate-*r*84.1%
associate-*r/84.1%
associate-/r/98.9%
*-commutative98.9%
associate-/l*99.0%
Applied egg-rr99.0%
if -9.9999999999999994e161 < (*.f64 a 2) < 4.99999999999999957e28Initial program 98.2%
if 4.99999999999999957e28 < (*.f64 a 2) Initial program 75.0%
*-commutative75.0%
*-commutative75.0%
associate-*l*74.9%
Simplified74.9%
Taylor expanded in x around 0 75.0%
+-commutative75.0%
fma-def75.0%
associate-/l*86.5%
associate-/l*92.3%
associate-/r/98.2%
Simplified98.2%
Final simplification98.3%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 2.0) -2e+178)
(+ (* t (/ z (* a -0.2222222222222222))) (* 0.5 (* x (/ y a))))
(if (<= (* a 2.0) 5e+28)
(/ (- (* x y) (* t (* z 9.0))) (* a 2.0))
(fma 0.5 (/ x (/ a y)) (* -4.5 (* z (/ t a)))))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 2.0) <= -2e+178) {
tmp = (t * (z / (a * -0.2222222222222222))) + (0.5 * (x * (y / a)));
} else if ((a * 2.0) <= 5e+28) {
tmp = ((x * y) - (t * (z * 9.0))) / (a * 2.0);
} else {
tmp = fma(0.5, (x / (a / y)), (-4.5 * (z * (t / a))));
}
return tmp;
}
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 2.0) <= -2e+178) tmp = Float64(Float64(t * Float64(z / Float64(a * -0.2222222222222222))) + Float64(0.5 * Float64(x * Float64(y / a)))); elseif (Float64(a * 2.0) <= 5e+28) tmp = Float64(Float64(Float64(x * y) - Float64(t * Float64(z * 9.0))) / Float64(a * 2.0)); else tmp = fma(0.5, Float64(x / Float64(a / y)), Float64(-4.5 * Float64(z * Float64(t / a)))); end return tmp end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 2.0), $MachinePrecision], -2e+178], N[(N[(t * N[(z / N[(a * -0.2222222222222222), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 2.0), $MachinePrecision], 5e+28], N[(N[(N[(x * y), $MachinePrecision] - N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] + N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq -2 \cdot 10^{+178}:\\
\;\;\;\;t \cdot \frac{z}{a \cdot -0.2222222222222222} + 0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{elif}\;a \cdot 2 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{x \cdot y - t \cdot \left(z \cdot 9\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{x}{\frac{a}{y}}, -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\right)\\
\end{array}
\end{array}
if (*.f64 a 2) < -2.0000000000000001e178Initial program 73.4%
*-commutative73.4%
*-commutative73.4%
associate-*l*73.5%
Simplified73.5%
Taylor expanded in x around 0 73.5%
+-commutative73.5%
fma-def73.5%
associate-/l*78.1%
associate-/l*98.9%
associate-/r/83.3%
Simplified83.3%
associate-*r*83.2%
associate-*r/83.2%
associate-/r/98.8%
*-commutative98.8%
associate-/l*99.0%
Applied egg-rr99.0%
fma-udef99.0%
div-inv99.0%
clear-num99.1%
div-inv99.0%
associate-/l/99.1%
*-commutative99.1%
clear-num99.0%
associate-/l*99.0%
div-inv98.9%
metadata-eval98.9%
Applied egg-rr98.9%
if -2.0000000000000001e178 < (*.f64 a 2) < 4.99999999999999957e28Initial program 98.2%
if 4.99999999999999957e28 < (*.f64 a 2) Initial program 75.0%
*-commutative75.0%
*-commutative75.0%
associate-*l*74.9%
Simplified74.9%
Taylor expanded in x around 0 75.0%
+-commutative75.0%
fma-def75.0%
associate-/l*86.5%
associate-/l*92.3%
associate-/r/98.2%
Simplified98.2%
Final simplification98.2%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* t (* z 9.0)))))
(if (or (<= t_1 -5e+251) (not (<= t_1 4e+275)))
(+ (* t (/ z (* a -0.2222222222222222))) (* 0.5 (* x (/ y a))))
(/ (- (* x y) (* z (* t 9.0))) (* a 2.0)))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (t * (z * 9.0));
double tmp;
if ((t_1 <= -5e+251) || !(t_1 <= 4e+275)) {
tmp = (t * (z / (a * -0.2222222222222222))) + (0.5 * (x * (y / a)));
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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) - (t * (z * 9.0d0))
if ((t_1 <= (-5d+251)) .or. (.not. (t_1 <= 4d+275))) then
tmp = (t * (z / (a * (-0.2222222222222222d0)))) + (0.5d0 * (x * (y / a)))
else
tmp = ((x * y) - (z * (t * 9.0d0))) / (a * 2.0d0)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (t * (z * 9.0));
double tmp;
if ((t_1 <= -5e+251) || !(t_1 <= 4e+275)) {
tmp = (t * (z / (a * -0.2222222222222222))) + (0.5 * (x * (y / a)));
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) - (t * (z * 9.0)) tmp = 0 if (t_1 <= -5e+251) or not (t_1 <= 4e+275): tmp = (t * (z / (a * -0.2222222222222222))) + (0.5 * (x * (y / a))) else: tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(t * Float64(z * 9.0))) tmp = 0.0 if ((t_1 <= -5e+251) || !(t_1 <= 4e+275)) tmp = Float64(Float64(t * Float64(z / Float64(a * -0.2222222222222222))) + Float64(0.5 * Float64(x * Float64(y / a)))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a * 2.0)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - (t * (z * 9.0));
tmp = 0.0;
if ((t_1 <= -5e+251) || ~((t_1 <= 4e+275)))
tmp = (t * (z / (a * -0.2222222222222222))) + (0.5 * (x * (y / a)));
else
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+251], N[Not[LessEqual[t$95$1, 4e+275]], $MachinePrecision]], N[(N[(t * N[(z / N[(a * -0.2222222222222222), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - t \cdot \left(z \cdot 9\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+251} \lor \neg \left(t_1 \leq 4 \cdot 10^{+275}\right):\\
\;\;\;\;t \cdot \frac{z}{a \cdot -0.2222222222222222} + 0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -5.0000000000000005e251 or 3.99999999999999984e275 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 73.8%
*-commutative73.8%
*-commutative73.8%
associate-*l*73.8%
Simplified73.8%
Taylor expanded in x around 0 68.0%
+-commutative68.0%
fma-def68.0%
associate-/l*79.9%
associate-/l*94.1%
associate-/r/91.7%
Simplified91.7%
associate-*r*91.6%
associate-*r/91.7%
associate-/r/94.0%
*-commutative94.0%
associate-/l*94.0%
Applied egg-rr94.0%
fma-udef94.0%
div-inv93.9%
clear-num93.9%
div-inv93.9%
associate-/l/93.9%
*-commutative93.9%
clear-num93.9%
associate-/l*93.9%
div-inv93.9%
metadata-eval93.9%
Applied egg-rr93.9%
if -5.0000000000000005e251 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 3.99999999999999984e275Initial program 99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
Simplified99.1%
Final simplification97.4%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* t (* z 9.0)) 1e+215) (/ (- (* x y) (* z (* t 9.0))) (* a 2.0)) (* -4.5 (/ t (/ a z)))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t * (z * 9.0)) <= 1e+215) {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t * (z * 9.0d0)) <= 1d+215) then
tmp = ((x * y) - (z * (t * 9.0d0))) / (a * 2.0d0)
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t * (z * 9.0)) <= 1e+215) {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (t * (z * 9.0)) <= 1e+215: tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0) else: tmp = -4.5 * (t / (a / z)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(t * Float64(z * 9.0)) <= 1e+215) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a * 2.0)); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((t * (z * 9.0)) <= 1e+215)
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision], 1e+215], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \cdot \left(z \cdot 9\right) \leq 10^{+215}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z 9) t) < 9.99999999999999907e214Initial program 93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
Simplified93.2%
if 9.99999999999999907e214 < (*.f64 (*.f64 z 9) t) Initial program 69.8%
*-commutative69.8%
*-commutative69.8%
associate-*l*69.8%
Simplified69.8%
Taylor expanded in x around 0 69.8%
associate-/l*96.4%
Simplified96.4%
Final simplification93.5%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* 0.5 (* y (/ x a))) (* (- (* x y) (* t (* z 9.0))) (/ 0.5 a))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = ((x * y) - (t * (z * 9.0))) * (0.5 / a);
}
return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = ((x * y) - (t * (z * 9.0))) * (0.5 / a);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = 0.5 * (y * (x / a)) else: tmp = ((x * y) - (t * (z * 9.0))) * (0.5 / a) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(0.5 * Float64(y * Float64(x / a))); else tmp = Float64(Float64(Float64(x * y) - Float64(t * Float64(z * 9.0))) * Float64(0.5 / a)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = 0.5 * (y * (x / a));
else
tmp = ((x * y) - (t * (z * 9.0))) * (0.5 / a);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y - t \cdot \left(z \cdot 9\right)\right) \cdot \frac{0.5}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 61.6%
*-commutative61.6%
*-commutative61.6%
associate-*l*61.6%
Simplified61.6%
Taylor expanded in x around 0 61.6%
+-commutative61.6%
fma-def61.6%
associate-/l*90.2%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in x around inf 61.6%
*-commutative61.6%
*-commutative61.6%
associate-*r/94.9%
Simplified94.9%
if -inf.0 < (*.f64 x y) Initial program 93.0%
*-commutative93.0%
*-commutative93.0%
associate-*l*92.9%
Simplified92.9%
div-sub89.6%
div-inv89.5%
*-commutative89.5%
associate-/r*89.5%
metadata-eval89.5%
div-inv89.5%
*-commutative89.5%
associate-/r*89.5%
metadata-eval89.5%
Applied egg-rr89.5%
distribute-rgt-out--92.8%
associate-*r*92.9%
*-commutative92.9%
Applied egg-rr92.9%
Final simplification93.0%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+17) (* 0.5 (* x (/ y a))) (if (<= (* x y) 2e+49) (/ -4.5 (/ (/ a t) z)) (* 0.5 (* y (/ x a))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+17) {
tmp = 0.5 * (x * (y / a));
} else if ((x * y) <= 2e+49) {
tmp = -4.5 / ((a / t) / z);
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 * y) <= (-2d+17)) then
tmp = 0.5d0 * (x * (y / a))
else if ((x * y) <= 2d+49) then
tmp = (-4.5d0) / ((a / t) / z)
else
tmp = 0.5d0 * (y * (x / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+17) {
tmp = 0.5 * (x * (y / a));
} else if ((x * y) <= 2e+49) {
tmp = -4.5 / ((a / t) / z);
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+17: tmp = 0.5 * (x * (y / a)) elif (x * y) <= 2e+49: tmp = -4.5 / ((a / t) / z) else: tmp = 0.5 * (y * (x / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+17) tmp = Float64(0.5 * Float64(x * Float64(y / a))); elseif (Float64(x * y) <= 2e+49) tmp = Float64(-4.5 / Float64(Float64(a / t) / z)); else tmp = Float64(0.5 * Float64(y * Float64(x / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+17)
tmp = 0.5 * (x * (y / a));
elseif ((x * y) <= 2e+49)
tmp = -4.5 / ((a / t) / z);
else
tmp = 0.5 * (y * (x / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+17], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+49], N[(-4.5 / N[(N[(a / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+17}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+49}:\\
\;\;\;\;\frac{-4.5}{\frac{\frac{a}{t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2e17Initial program 87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in x around inf 75.6%
associate-/l*83.8%
Simplified83.8%
clear-num83.8%
associate-/r/83.8%
clear-num83.8%
Applied egg-rr83.8%
if -2e17 < (*.f64 x y) < 1.99999999999999989e49Initial program 93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around 0 77.9%
associate-*r/77.8%
associate-*r*77.8%
Simplified77.8%
associate-/l*75.8%
associate-/r/79.2%
associate-*r/79.2%
clear-num79.3%
un-div-inv79.3%
Applied egg-rr79.3%
associate-*l/79.4%
associate-/l*79.3%
Applied egg-rr79.3%
if 1.99999999999999989e49 < (*.f64 x y) Initial program 87.5%
*-commutative87.5%
*-commutative87.5%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in x around 0 79.9%
+-commutative79.9%
fma-def79.9%
associate-/l*88.8%
associate-/l*90.4%
associate-/r/86.8%
Simplified86.8%
Taylor expanded in x around inf 69.1%
*-commutative69.1%
*-commutative69.1%
associate-*r/74.3%
Simplified74.3%
Final simplification79.4%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -3.1e-158) (* -4.5 (/ t (/ a z))) (if (<= t 2.25e+34) (* 0.5 (* x (/ y a))) (* -4.5 (* z (/ t a))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e-158) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 2.25e+34) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.1d-158)) then
tmp = (-4.5d0) * (t / (a / z))
else if (t <= 2.25d+34) then
tmp = 0.5d0 * (x * (y / a))
else
tmp = (-4.5d0) * (z * (t / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e-158) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 2.25e+34) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -3.1e-158: tmp = -4.5 * (t / (a / z)) elif t <= 2.25e+34: tmp = 0.5 * (x * (y / a)) else: tmp = -4.5 * (z * (t / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e-158) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (t <= 2.25e+34) tmp = Float64(0.5 * Float64(x * Float64(y / a))); else tmp = Float64(-4.5 * Float64(z * Float64(t / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -3.1e-158)
tmp = -4.5 * (t / (a / z));
elseif (t <= 2.25e+34)
tmp = 0.5 * (x * (y / a));
else
tmp = -4.5 * (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e-158], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e+34], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-158}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+34}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if t < -3.10000000000000018e-158Initial program 88.5%
*-commutative88.5%
*-commutative88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around 0 58.1%
associate-/l*65.7%
Simplified65.7%
if -3.10000000000000018e-158 < t < 2.25e34Initial program 93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in x around inf 70.6%
associate-/l*75.1%
Simplified75.1%
clear-num75.2%
associate-/r/74.5%
clear-num74.6%
Applied egg-rr74.6%
if 2.25e34 < t Initial program 89.3%
*-commutative89.3%
*-commutative89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around 0 64.3%
associate-/l*60.9%
associate-/r/77.7%
Simplified77.7%
Final simplification71.9%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -3.1e-158) (* -4.5 (/ t (/ a z))) (if (<= t 7.4e+33) (* 0.5 (/ x (/ a y))) (* -4.5 (* z (/ t a))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e-158) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 7.4e+33) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.1d-158)) then
tmp = (-4.5d0) * (t / (a / z))
else if (t <= 7.4d+33) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = (-4.5d0) * (z * (t / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.1e-158) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 7.4e+33) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -3.1e-158: tmp = -4.5 * (t / (a / z)) elif t <= 7.4e+33: tmp = 0.5 * (x / (a / y)) else: tmp = -4.5 * (z * (t / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.1e-158) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (t <= 7.4e+33) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = Float64(-4.5 * Float64(z * Float64(t / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -3.1e-158)
tmp = -4.5 * (t / (a / z));
elseif (t <= 7.4e+33)
tmp = 0.5 * (x / (a / y));
else
tmp = -4.5 * (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.1e-158], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.4e+33], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-158}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{+33}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if t < -3.10000000000000018e-158Initial program 88.5%
*-commutative88.5%
*-commutative88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around 0 58.1%
associate-/l*65.7%
Simplified65.7%
if -3.10000000000000018e-158 < t < 7.3999999999999997e33Initial program 93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in x around inf 70.6%
associate-/l*75.1%
Simplified75.1%
if 7.3999999999999997e33 < t Initial program 89.3%
*-commutative89.3%
*-commutative89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around 0 64.3%
associate-/l*60.9%
associate-/r/77.7%
Simplified77.7%
Final simplification72.1%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -8e-194) (* -4.5 (/ t (/ a z))) (if (<= t 1.7e+34) (* y (* x (/ 0.5 a))) (* -4.5 (* z (/ t a))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-194) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 1.7e+34) {
tmp = y * (x * (0.5 / a));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-8d-194)) then
tmp = (-4.5d0) * (t / (a / z))
else if (t <= 1.7d+34) then
tmp = y * (x * (0.5d0 / a))
else
tmp = (-4.5d0) * (z * (t / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-194) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 1.7e+34) {
tmp = y * (x * (0.5 / a));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -8e-194: tmp = -4.5 * (t / (a / z)) elif t <= 1.7e+34: tmp = y * (x * (0.5 / a)) else: tmp = -4.5 * (z * (t / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -8e-194) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (t <= 1.7e+34) tmp = Float64(y * Float64(x * Float64(0.5 / a))); else tmp = Float64(-4.5 * Float64(z * Float64(t / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -8e-194)
tmp = -4.5 * (t / (a / z));
elseif (t <= 1.7e+34)
tmp = y * (x * (0.5 / a));
else
tmp = -4.5 * (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8e-194], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+34], N[(y * N[(x * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-194}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+34}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{0.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if t < -8.00000000000000014e-194Initial program 89.2%
*-commutative89.2%
*-commutative89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around 0 57.1%
associate-/l*63.4%
Simplified63.4%
if -8.00000000000000014e-194 < t < 1.7e34Initial program 93.3%
*-commutative93.3%
*-commutative93.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
fma-def92.1%
associate-/l*96.9%
associate-/l*90.5%
associate-/r/93.8%
Simplified93.8%
Taylor expanded in x around inf 71.6%
*-commutative71.6%
associate-*l/71.6%
associate-*r/71.6%
*-commutative71.6%
associate-*l*74.8%
Simplified74.8%
if 1.7e34 < t Initial program 89.3%
*-commutative89.3%
*-commutative89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around 0 64.3%
associate-/l*60.9%
associate-/r/77.7%
Simplified77.7%
Final simplification70.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -8e-194) (* -4.5 (/ t (/ a z))) (if (<= t 1.35e+34) (* 0.5 (* y (/ x a))) (* -4.5 (* z (/ t a))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-194) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 1.35e+34) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-8d-194)) then
tmp = (-4.5d0) * (t / (a / z))
else if (t <= 1.35d+34) then
tmp = 0.5d0 * (y * (x / a))
else
tmp = (-4.5d0) * (z * (t / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-194) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 1.35e+34) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -8e-194: tmp = -4.5 * (t / (a / z)) elif t <= 1.35e+34: tmp = 0.5 * (y * (x / a)) else: tmp = -4.5 * (z * (t / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -8e-194) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (t <= 1.35e+34) tmp = Float64(0.5 * Float64(y * Float64(x / a))); else tmp = Float64(-4.5 * Float64(z * Float64(t / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -8e-194)
tmp = -4.5 * (t / (a / z));
elseif (t <= 1.35e+34)
tmp = 0.5 * (y * (x / a));
else
tmp = -4.5 * (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8e-194], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+34], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-194}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+34}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if t < -8.00000000000000014e-194Initial program 89.2%
*-commutative89.2%
*-commutative89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around 0 57.1%
associate-/l*63.4%
Simplified63.4%
if -8.00000000000000014e-194 < t < 1.35e34Initial program 93.3%
*-commutative93.3%
*-commutative93.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
fma-def92.1%
associate-/l*96.9%
associate-/l*90.5%
associate-/r/93.8%
Simplified93.8%
Taylor expanded in x around inf 71.6%
*-commutative71.6%
*-commutative71.6%
associate-*r/74.8%
Simplified74.8%
if 1.35e34 < t Initial program 89.3%
*-commutative89.3%
*-commutative89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around 0 64.3%
associate-/l*60.9%
associate-/r/77.7%
Simplified77.7%
Final simplification70.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -8e-194) (* -4.5 (/ t (/ a z))) (if (<= t 9.5e+33) (* 0.5 (* y (/ x a))) (* z (/ -4.5 (/ a t))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-194) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 9.5e+33) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = z * (-4.5 / (a / t));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-8d-194)) then
tmp = (-4.5d0) * (t / (a / z))
else if (t <= 9.5d+33) then
tmp = 0.5d0 * (y * (x / a))
else
tmp = z * ((-4.5d0) / (a / t))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-194) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 9.5e+33) {
tmp = 0.5 * (y * (x / a));
} else {
tmp = z * (-4.5 / (a / t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -8e-194: tmp = -4.5 * (t / (a / z)) elif t <= 9.5e+33: tmp = 0.5 * (y * (x / a)) else: tmp = z * (-4.5 / (a / t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -8e-194) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (t <= 9.5e+33) tmp = Float64(0.5 * Float64(y * Float64(x / a))); else tmp = Float64(z * Float64(-4.5 / Float64(a / t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -8e-194)
tmp = -4.5 * (t / (a / z));
elseif (t <= 9.5e+33)
tmp = 0.5 * (y * (x / a));
else
tmp = z * (-4.5 / (a / t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8e-194], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+33], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(-4.5 / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-194}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+33}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-4.5}{\frac{a}{t}}\\
\end{array}
\end{array}
if t < -8.00000000000000014e-194Initial program 89.2%
*-commutative89.2%
*-commutative89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around 0 57.1%
associate-/l*63.4%
Simplified63.4%
if -8.00000000000000014e-194 < t < 9.5000000000000003e33Initial program 93.3%
*-commutative93.3%
*-commutative93.3%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
fma-def92.1%
associate-/l*96.9%
associate-/l*90.5%
associate-/r/93.8%
Simplified93.8%
Taylor expanded in x around inf 71.6%
*-commutative71.6%
*-commutative71.6%
associate-*r/74.8%
Simplified74.8%
if 9.5000000000000003e33 < t Initial program 89.3%
*-commutative89.3%
*-commutative89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around 0 64.3%
associate-*r/64.3%
associate-*r*64.3%
Simplified64.3%
associate-/l*60.9%
associate-/r/77.6%
associate-*r/77.6%
clear-num77.6%
un-div-inv77.6%
Applied egg-rr77.6%
Final simplification70.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= x -1.56e+69) (* -4.5 (/ t (/ a z))) (* -4.5 (* z (/ t a)))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.56e+69) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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.56d+69)) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = (-4.5d0) * (z * (t / a))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.56e+69) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if x <= -1.56e+69: tmp = -4.5 * (t / (a / z)) else: tmp = -4.5 * (z * (t / a)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.56e+69) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(-4.5 * Float64(z * Float64(t / a))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -1.56e+69)
tmp = -4.5 * (t / (a / z));
else
tmp = -4.5 * (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.56e+69], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.56 \cdot 10^{+69}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if x < -1.56000000000000007e69Initial program 92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in x around 0 31.2%
associate-/l*31.3%
Simplified31.3%
if -1.56000000000000007e69 < x Initial program 90.3%
*-commutative90.3%
*-commutative90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around 0 56.6%
associate-/l*57.9%
associate-/r/61.0%
Simplified61.0%
Final simplification55.5%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (* z (/ t a))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 = (-4.5d0) * (z * (t / a))
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): return -4.5 * (z * (t / a))
z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(z * Float64(t / a))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (z * (t / a));
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 90.6%
*-commutative90.6%
*-commutative90.6%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in x around 0 51.9%
associate-/l*53.0%
associate-/r/56.3%
Simplified56.3%
Final simplification56.3%
(FPCore (x y z t a)
:precision binary64
(if (< a -2.090464557976709e+86)
(- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
(if (< a 2.144030707833976e+99)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a < (-2.090464557976709d+86)) then
tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
else if (a < 2.144030707833976d+99) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a < -2.090464557976709e+86: tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))) elif a < 2.144030707833976e+99: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a < -2.090464557976709e+86) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z)))); elseif (a < 2.144030707833976e+99) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a < -2.090464557976709e+86) tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))); elseif (a < 2.144030707833976e+99) tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0); else tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\
\end{array}
\end{array}
herbie shell --seed 2023314
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))