
(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 11 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: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (- (* x y) (* (* z 9.0) t)) -2e+304) (* y (* t (+ (* -4.5 (/ z (* y a))) (* 0.5 (/ x (* t a)))))) (* (fma z (* t -9.0) (* x y)) (/ 0.5 a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) - ((z * 9.0) * t)) <= -2e+304) {
tmp = y * (t * ((-4.5 * (z / (y * a))) + (0.5 * (x / (t * a)))));
} else {
tmp = fma(z, (t * -9.0), (x * y)) * (0.5 / a);
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) <= -2e+304) tmp = Float64(y * Float64(t * Float64(Float64(-4.5 * Float64(z / Float64(y * a))) + Float64(0.5 * Float64(x / Float64(t * a)))))); else tmp = Float64(fma(z, Float64(t * -9.0), Float64(x * y)) * Float64(0.5 / a)); end return tmp end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], -2e+304], N[(y * N[(t * N[(N[(-4.5 * N[(z / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x / N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(t * -9.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq -2 \cdot 10^{+304}:\\
\;\;\;\;y \cdot \left(t \cdot \left(-4.5 \cdot \frac{z}{y \cdot a} + 0.5 \cdot \frac{x}{t \cdot a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t \cdot -9, x \cdot y\right) \cdot \frac{0.5}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -1.9999999999999999e304Initial program 71.5%
div-sub62.4%
*-commutative62.4%
div-sub71.5%
cancel-sign-sub-inv71.5%
*-commutative71.5%
fma-define71.5%
distribute-rgt-neg-in71.5%
associate-*r*74.2%
distribute-lft-neg-in74.2%
*-commutative74.2%
distribute-rgt-neg-in74.2%
metadata-eval74.2%
Simplified74.2%
Taylor expanded in y around inf 85.7%
Taylor expanded in t around inf 85.5%
if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 96.3%
div-sub93.5%
*-commutative93.5%
div-sub96.3%
cancel-sign-sub-inv96.3%
*-commutative96.3%
fma-define96.3%
distribute-rgt-neg-in96.3%
associate-*r*96.3%
distribute-lft-neg-in96.3%
*-commutative96.3%
distribute-rgt-neg-in96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in a around 0 96.2%
associate-*r/96.2%
+-commutative96.2%
metadata-eval96.2%
cancel-sign-sub-inv96.2%
cancel-sign-sub-inv96.2%
metadata-eval96.2%
*-commutative96.2%
*-commutative96.2%
associate-*r*96.3%
fma-define96.3%
associate-*l/96.2%
*-commutative96.2%
fma-define96.2%
+-commutative96.2%
fma-define97.1%
Simplified97.1%
Final simplification95.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= (* x y) -2e+79) (not (<= (* x y) 5000000.0))) (* 0.5 (* x (/ y a))) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) <= -2e+79) || !((x * y) <= 5000000.0)) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a 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+79)) .or. (.not. ((x * y) <= 5000000.0d0))) then
tmp = 0.5d0 * (x * (y / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) <= -2e+79) || !((x * y) <= 5000000.0)) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if ((x * y) <= -2e+79) or not ((x * y) <= 5000000.0): tmp = 0.5 * (x * (y / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((Float64(x * y) <= -2e+79) || !(Float64(x * y) <= 5000000.0)) tmp = Float64(0.5 * Float64(x * Float64(y / a))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (((x * y) <= -2e+79) || ~(((x * y) <= 5000000.0)))
tmp = 0.5 * (x * (y / a));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+79], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5000000.0]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+79} \lor \neg \left(x \cdot y \leq 5000000\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e79 or 5e6 < (*.f64 x y) Initial program 89.0%
div-sub80.5%
*-commutative80.5%
div-sub89.0%
cancel-sign-sub-inv89.0%
*-commutative89.0%
fma-define89.0%
distribute-rgt-neg-in89.0%
associate-*r*89.9%
distribute-lft-neg-in89.9%
*-commutative89.9%
distribute-rgt-neg-in89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in x around inf 80.8%
associate-/l*86.1%
Simplified86.1%
if -1.99999999999999993e79 < (*.f64 x y) < 5e6Initial program 95.9%
div-sub95.9%
*-commutative95.9%
div-sub95.9%
cancel-sign-sub-inv95.9%
*-commutative95.9%
fma-define95.9%
distribute-rgt-neg-in95.9%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in x around 0 74.9%
Final simplification79.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+79) (/ x (* 2.0 (/ a y))) (if (<= (* x y) 5000000.0) (/ (* t (* z -4.5)) a) (* 0.5 (* x (/ y a))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+79) {
tmp = x / (2.0 * (a / y));
} else if ((x * y) <= 5000000.0) {
tmp = (t * (z * -4.5)) / a;
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
NOTE: x, y, z, t, and a 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+79)) then
tmp = x / (2.0d0 * (a / y))
else if ((x * y) <= 5000000.0d0) then
tmp = (t * (z * (-4.5d0))) / a
else
tmp = 0.5d0 * (x * (y / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+79) {
tmp = x / (2.0 * (a / y));
} else if ((x * y) <= 5000000.0) {
tmp = (t * (z * -4.5)) / a;
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+79: tmp = x / (2.0 * (a / y)) elif (x * y) <= 5000000.0: tmp = (t * (z * -4.5)) / a else: tmp = 0.5 * (x * (y / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+79) tmp = Float64(x / Float64(2.0 * Float64(a / y))); elseif (Float64(x * y) <= 5000000.0) tmp = Float64(Float64(t * Float64(z * -4.5)) / a); else tmp = Float64(0.5 * Float64(x * Float64(y / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+79)
tmp = x / (2.0 * (a / y));
elseif ((x * y) <= 5000000.0)
tmp = (t * (z * -4.5)) / a;
else
tmp = 0.5 * (x * (y / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+79], N[(x / N[(2.0 * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5000000.0], N[(N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{2 \cdot \frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 5000000:\\
\;\;\;\;\frac{t \cdot \left(z \cdot -4.5\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e79Initial program 84.9%
div-sub81.0%
*-commutative81.0%
div-sub84.9%
cancel-sign-sub-inv84.9%
*-commutative84.9%
fma-define84.9%
distribute-rgt-neg-in84.9%
associate-*r*86.7%
distribute-lft-neg-in86.7%
*-commutative86.7%
distribute-rgt-neg-in86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in a around 0 86.7%
associate-*r/86.7%
+-commutative86.7%
metadata-eval86.7%
cancel-sign-sub-inv86.7%
cancel-sign-sub-inv86.7%
metadata-eval86.7%
*-commutative86.7%
*-commutative86.7%
associate-*r*86.7%
fma-define86.7%
associate-*l/86.7%
*-commutative86.7%
fma-define86.7%
+-commutative86.7%
fma-define88.7%
Simplified88.7%
Taylor expanded in z around 0 82.6%
associate-*l/88.3%
associate-*l*88.3%
*-commutative88.3%
associate-*r*88.3%
associate-*r/82.6%
*-commutative82.6%
associate-*l/91.9%
associate-*r/91.9%
*-commutative91.9%
associate-*r/91.9%
Simplified91.9%
clear-num91.8%
un-div-inv92.0%
*-un-lft-identity92.0%
times-frac92.0%
metadata-eval92.0%
Applied egg-rr92.0%
if -1.99999999999999993e79 < (*.f64 x y) < 5e6Initial program 95.9%
div-sub95.9%
*-commutative95.9%
div-sub95.9%
cancel-sign-sub-inv95.9%
*-commutative95.9%
fma-define95.9%
distribute-rgt-neg-in95.9%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in a around 0 95.9%
associate-*r/95.9%
+-commutative95.9%
metadata-eval95.9%
cancel-sign-sub-inv95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
*-commutative95.9%
*-commutative95.9%
associate-*r*96.0%
fma-define96.0%
associate-*l/95.9%
*-commutative95.9%
fma-define95.9%
+-commutative95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in z around inf 74.9%
associate-*r/68.9%
associate-*r*68.9%
*-commutative68.9%
*-commutative68.9%
*-commutative68.9%
Simplified68.9%
associate-*l/75.0%
associate-*r*74.9%
Applied egg-rr74.9%
if 5e6 < (*.f64 x y) Initial program 92.8%
div-sub80.0%
*-commutative80.0%
div-sub92.8%
cancel-sign-sub-inv92.8%
*-commutative92.8%
fma-define92.8%
distribute-rgt-neg-in92.8%
associate-*r*92.9%
distribute-lft-neg-in92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
Taylor expanded in x around inf 79.2%
associate-/l*80.7%
Simplified80.7%
Final simplification79.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+79) (/ x (* 2.0 (/ a y))) (if (<= (* x y) 5000000.0) (/ (* -4.5 (* z t)) a) (* 0.5 (* x (/ y a))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+79) {
tmp = x / (2.0 * (a / y));
} else if ((x * y) <= 5000000.0) {
tmp = (-4.5 * (z * t)) / a;
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
NOTE: x, y, z, t, and a 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+79)) then
tmp = x / (2.0d0 * (a / y))
else if ((x * y) <= 5000000.0d0) then
tmp = ((-4.5d0) * (z * t)) / a
else
tmp = 0.5d0 * (x * (y / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+79) {
tmp = x / (2.0 * (a / y));
} else if ((x * y) <= 5000000.0) {
tmp = (-4.5 * (z * t)) / a;
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+79: tmp = x / (2.0 * (a / y)) elif (x * y) <= 5000000.0: tmp = (-4.5 * (z * t)) / a else: tmp = 0.5 * (x * (y / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+79) tmp = Float64(x / Float64(2.0 * Float64(a / y))); elseif (Float64(x * y) <= 5000000.0) tmp = Float64(Float64(-4.5 * Float64(z * t)) / a); else tmp = Float64(0.5 * Float64(x * Float64(y / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+79)
tmp = x / (2.0 * (a / y));
elseif ((x * y) <= 5000000.0)
tmp = (-4.5 * (z * t)) / a;
else
tmp = 0.5 * (x * (y / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+79], N[(x / N[(2.0 * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5000000.0], N[(N[(-4.5 * N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{2 \cdot \frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 5000000:\\
\;\;\;\;\frac{-4.5 \cdot \left(z \cdot t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e79Initial program 84.9%
div-sub81.0%
*-commutative81.0%
div-sub84.9%
cancel-sign-sub-inv84.9%
*-commutative84.9%
fma-define84.9%
distribute-rgt-neg-in84.9%
associate-*r*86.7%
distribute-lft-neg-in86.7%
*-commutative86.7%
distribute-rgt-neg-in86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in a around 0 86.7%
associate-*r/86.7%
+-commutative86.7%
metadata-eval86.7%
cancel-sign-sub-inv86.7%
cancel-sign-sub-inv86.7%
metadata-eval86.7%
*-commutative86.7%
*-commutative86.7%
associate-*r*86.7%
fma-define86.7%
associate-*l/86.7%
*-commutative86.7%
fma-define86.7%
+-commutative86.7%
fma-define88.7%
Simplified88.7%
Taylor expanded in z around 0 82.6%
associate-*l/88.3%
associate-*l*88.3%
*-commutative88.3%
associate-*r*88.3%
associate-*r/82.6%
*-commutative82.6%
associate-*l/91.9%
associate-*r/91.9%
*-commutative91.9%
associate-*r/91.9%
Simplified91.9%
clear-num91.8%
un-div-inv92.0%
*-un-lft-identity92.0%
times-frac92.0%
metadata-eval92.0%
Applied egg-rr92.0%
if -1.99999999999999993e79 < (*.f64 x y) < 5e6Initial program 95.9%
div-sub95.9%
*-commutative95.9%
div-sub95.9%
cancel-sign-sub-inv95.9%
*-commutative95.9%
fma-define95.9%
distribute-rgt-neg-in95.9%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in a around 0 95.9%
associate-*r/95.9%
+-commutative95.9%
metadata-eval95.9%
cancel-sign-sub-inv95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
*-commutative95.9%
*-commutative95.9%
associate-*r*96.0%
fma-define96.0%
associate-*l/95.9%
*-commutative95.9%
fma-define95.9%
+-commutative95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in z around inf 74.9%
associate-*r/68.9%
associate-*r*68.9%
*-commutative68.9%
*-commutative68.9%
*-commutative68.9%
Simplified68.9%
associate-*l/75.0%
associate-*r*74.9%
Applied egg-rr74.9%
Taylor expanded in z around 0 74.9%
associate-*r/74.9%
Simplified74.9%
if 5e6 < (*.f64 x y) Initial program 92.8%
div-sub80.0%
*-commutative80.0%
div-sub92.8%
cancel-sign-sub-inv92.8%
*-commutative92.8%
fma-define92.8%
distribute-rgt-neg-in92.8%
associate-*r*92.9%
distribute-lft-neg-in92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
Taylor expanded in x around inf 79.2%
associate-/l*80.7%
Simplified80.7%
Final simplification79.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+79) (/ x (* 2.0 (/ a y))) (if (<= (* x y) 5000000.0) (* -4.5 (/ (* z t) a)) (* 0.5 (* x (/ y a))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+79) {
tmp = x / (2.0 * (a / y));
} else if ((x * y) <= 5000000.0) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
NOTE: x, y, z, t, and a 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+79)) then
tmp = x / (2.0d0 * (a / y))
else if ((x * y) <= 5000000.0d0) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = 0.5d0 * (x * (y / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+79) {
tmp = x / (2.0 * (a / y));
} else if ((x * y) <= 5000000.0) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+79: tmp = x / (2.0 * (a / y)) elif (x * y) <= 5000000.0: tmp = -4.5 * ((z * t) / a) else: tmp = 0.5 * (x * (y / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+79) tmp = Float64(x / Float64(2.0 * Float64(a / y))); elseif (Float64(x * y) <= 5000000.0) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(0.5 * Float64(x * Float64(y / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+79)
tmp = x / (2.0 * (a / y));
elseif ((x * y) <= 5000000.0)
tmp = -4.5 * ((z * t) / a);
else
tmp = 0.5 * (x * (y / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+79], N[(x / N[(2.0 * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5000000.0], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{2 \cdot \frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 5000000:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e79Initial program 84.9%
div-sub81.0%
*-commutative81.0%
div-sub84.9%
cancel-sign-sub-inv84.9%
*-commutative84.9%
fma-define84.9%
distribute-rgt-neg-in84.9%
associate-*r*86.7%
distribute-lft-neg-in86.7%
*-commutative86.7%
distribute-rgt-neg-in86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in a around 0 86.7%
associate-*r/86.7%
+-commutative86.7%
metadata-eval86.7%
cancel-sign-sub-inv86.7%
cancel-sign-sub-inv86.7%
metadata-eval86.7%
*-commutative86.7%
*-commutative86.7%
associate-*r*86.7%
fma-define86.7%
associate-*l/86.7%
*-commutative86.7%
fma-define86.7%
+-commutative86.7%
fma-define88.7%
Simplified88.7%
Taylor expanded in z around 0 82.6%
associate-*l/88.3%
associate-*l*88.3%
*-commutative88.3%
associate-*r*88.3%
associate-*r/82.6%
*-commutative82.6%
associate-*l/91.9%
associate-*r/91.9%
*-commutative91.9%
associate-*r/91.9%
Simplified91.9%
clear-num91.8%
un-div-inv92.0%
*-un-lft-identity92.0%
times-frac92.0%
metadata-eval92.0%
Applied egg-rr92.0%
if -1.99999999999999993e79 < (*.f64 x y) < 5e6Initial program 95.9%
div-sub95.9%
*-commutative95.9%
div-sub95.9%
cancel-sign-sub-inv95.9%
*-commutative95.9%
fma-define95.9%
distribute-rgt-neg-in95.9%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in x around 0 74.9%
if 5e6 < (*.f64 x y) Initial program 92.8%
div-sub80.0%
*-commutative80.0%
div-sub92.8%
cancel-sign-sub-inv92.8%
*-commutative92.8%
fma-define92.8%
distribute-rgt-neg-in92.8%
associate-*r*92.9%
distribute-lft-neg-in92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
Taylor expanded in x around inf 79.2%
associate-/l*80.7%
Simplified80.7%
Final simplification79.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* y (/ (* x 0.5) a)) (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = y * ((x * 0.5) / a) else: tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = y * ((x * 0.5) / a);
else
tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.8%
div-sub54.2%
*-commutative54.2%
div-sub64.8%
cancel-sign-sub-inv64.8%
*-commutative64.8%
fma-define64.8%
distribute-rgt-neg-in64.8%
associate-*r*64.8%
distribute-lft-neg-in64.8%
*-commutative64.8%
distribute-rgt-neg-in64.8%
metadata-eval64.8%
Simplified64.8%
Taylor expanded in y around inf 94.5%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
Simplified99.8%
if -inf.0 < (*.f64 x y) Initial program 95.3%
Final simplification95.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* y (/ (* x 0.5) a)) (/ (- (* x y) (* 9.0 (* z t))) (* a 2.0))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - (9.0 * (z * t))) / (a * 2.0);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - (9.0 * (z * t))) / (a * 2.0);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = y * ((x * 0.5) / a) else: tmp = ((x * y) - (9.0 * (z * t))) / (a * 2.0) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(9.0 * Float64(z * t))) / Float64(a * 2.0)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = y * ((x * 0.5) / a);
else
tmp = ((x * y) - (9.0 * (z * t))) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - 9 \cdot \left(z \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.8%
div-sub54.2%
*-commutative54.2%
div-sub64.8%
cancel-sign-sub-inv64.8%
*-commutative64.8%
fma-define64.8%
distribute-rgt-neg-in64.8%
associate-*r*64.8%
distribute-lft-neg-in64.8%
*-commutative64.8%
distribute-rgt-neg-in64.8%
metadata-eval64.8%
Simplified64.8%
Taylor expanded in y around inf 94.5%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
Simplified99.8%
if -inf.0 < (*.f64 x y) Initial program 95.3%
Taylor expanded in z around 0 95.7%
Final simplification96.0%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* y (/ (* x 0.5) a)) (* (/ 0.5 a) (+ (* x y) (* -9.0 (* z t))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = (0.5 / a) * ((x * y) + (-9.0 * (z * t)));
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = (0.5 / a) * ((x * y) + (-9.0 * (z * t)));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = y * ((x * 0.5) / a) else: tmp = (0.5 / a) * ((x * y) + (-9.0 * (z * t))) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(Float64(0.5 / a) * Float64(Float64(x * y) + Float64(-9.0 * Float64(z * t)))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = y * ((x * 0.5) / a);
else
tmp = (0.5 / a) * ((x * y) + (-9.0 * (z * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 / a), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] + N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(x \cdot y + -9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.8%
div-sub54.2%
*-commutative54.2%
div-sub64.8%
cancel-sign-sub-inv64.8%
*-commutative64.8%
fma-define64.8%
distribute-rgt-neg-in64.8%
associate-*r*64.8%
distribute-lft-neg-in64.8%
*-commutative64.8%
distribute-rgt-neg-in64.8%
metadata-eval64.8%
Simplified64.8%
Taylor expanded in y around inf 94.5%
Taylor expanded in t around 0 99.8%
associate-*r/99.8%
Simplified99.8%
if -inf.0 < (*.f64 x y) Initial program 95.3%
div-sub92.4%
*-commutative92.4%
div-sub95.3%
cancel-sign-sub-inv95.3%
*-commutative95.3%
fma-define95.3%
distribute-rgt-neg-in95.3%
associate-*r*95.8%
distribute-lft-neg-in95.8%
*-commutative95.8%
distribute-rgt-neg-in95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in a around 0 95.7%
associate-*r/95.7%
+-commutative95.7%
metadata-eval95.7%
cancel-sign-sub-inv95.7%
cancel-sign-sub-inv95.7%
metadata-eval95.7%
*-commutative95.7%
*-commutative95.7%
associate-*r*95.8%
fma-define95.8%
associate-*l/95.7%
*-commutative95.7%
fma-define95.7%
+-commutative95.7%
fma-define96.1%
Simplified96.1%
Taylor expanded in z around 0 95.7%
Final simplification96.0%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (/ (* z t) a)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return -4.5 * ((z * t) / a);
}
NOTE: x, y, z, t, and a 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 x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * ((z * t) / a);
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return -4.5 * ((z * t) / a)
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(Float64(z * t) / a)) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * ((z * t) / a);
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-4.5 \cdot \frac{z \cdot t}{a}
\end{array}
Initial program 93.1%
div-sub89.5%
*-commutative89.5%
div-sub93.1%
cancel-sign-sub-inv93.1%
*-commutative93.1%
fma-define93.1%
distribute-rgt-neg-in93.1%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in x around 0 53.0%
Final simplification53.0%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (* z (/ t a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
NOTE: x, y, z, t, and a 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 x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return -4.5 * (z * (t / a))
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(z * Float64(t / a))) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (z * (t / a));
end
NOTE: x, y, z, t, and a 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}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 93.1%
div-sub89.5%
*-commutative89.5%
div-sub93.1%
cancel-sign-sub-inv93.1%
*-commutative93.1%
fma-define93.1%
distribute-rgt-neg-in93.1%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in x around 0 53.0%
associate-*r/53.0%
associate-*r*53.0%
associate-*l/51.6%
associate-*r/51.6%
associate-*l*51.5%
Simplified51.5%
Final simplification51.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (* t (/ z a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
NOTE: x, y, z, t, and a 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) * (t * (z / a))
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return -4.5 * (t * (z / a))
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(t * Float64(z / a))) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (t * (z / a));
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-4.5 \cdot \left(t \cdot \frac{z}{a}\right)
\end{array}
Initial program 93.1%
div-sub89.5%
*-commutative89.5%
div-sub93.1%
cancel-sign-sub-inv93.1%
*-commutative93.1%
fma-define93.1%
distribute-rgt-neg-in93.1%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in x around 0 53.0%
associate-/l*49.5%
Simplified49.5%
(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 2024165
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:alt
(! :herbie-platform default (if (< a -209046455797670900000000000000000000000000000000000000000000000000000000000000000000000) (- (* 1/2 (/ (* y x) a)) (* 9/2 (/ t (/ a z)))) (if (< a 2144030707833976000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z (* 9 t))) (* a 2)) (- (* (/ y a) (* x 1/2)) (* (/ t a) (* z 9/2))))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))