
(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 and y 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)) 1e+272) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (+ (* (* z -4.5) (/ t a)) (* (* x 0.5) (/ y a)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) - ((z * 9.0) * t)) <= 1e+272) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((z * -4.5) * (t / a)) + ((x * 0.5) * (y / a));
}
return tmp;
}
NOTE: x and y 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) - ((z * 9.0d0) * t)) <= 1d+272) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((z * (-4.5d0)) * (t / a)) + ((x * 0.5d0) * (y / a))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) - ((z * 9.0) * t)) <= 1e+272) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((z * -4.5) * (t / a)) + ((x * 0.5) * (y / a));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if ((x * y) - ((z * 9.0) * t)) <= 1e+272: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((z * -4.5) * (t / a)) + ((x * 0.5) * (y / a)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) <= 1e+272) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(z * -4.5) * Float64(t / a)) + Float64(Float64(x * 0.5) * Float64(y / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (((x * y) - ((z * 9.0) * t)) <= 1e+272)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = ((z * -4.5) * (t / a)) + ((x * 0.5) * (y / a));
end
tmp_2 = tmp;
end
NOTE: x and y 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], 1e+272], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * -4.5), $MachinePrecision] * N[(t / a), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 0.5), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y - \left(z \cdot 9\right) \cdot t \leq 10^{+272}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot -4.5\right) \cdot \frac{t}{a} + \left(x \cdot 0.5\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 1.0000000000000001e272Initial program 97.5%
*-commutative97.5%
*-commutative97.5%
associate-*l*97.5%
Simplified97.5%
if 1.0000000000000001e272 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 72.5%
*-commutative72.5%
*-commutative72.5%
associate-*l*72.5%
Simplified72.5%
Taylor expanded in x around 0 72.5%
fma-def72.5%
associate-/l*82.4%
associate-/r/79.7%
associate-*r/94.4%
Simplified94.4%
fma-udef94.4%
*-commutative94.4%
associate-*r*94.4%
associate-*r*94.4%
Applied egg-rr94.4%
Final simplification97.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) 1e+262) (/ 0.5 (/ a (+ (* x y) (* t (* z -9.0))))) (* 0.5 (* x (/ y a)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 1e+262) {
tmp = 0.5 / (a / ((x * y) + (t * (z * -9.0))));
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
NOTE: x and y 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) <= 1d+262) then
tmp = 0.5d0 / (a / ((x * y) + (t * (z * (-9.0d0)))))
else
tmp = 0.5d0 * (x * (y / a))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 1e+262) {
tmp = 0.5 / (a / ((x * y) + (t * (z * -9.0))));
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= 1e+262: tmp = 0.5 / (a / ((x * y) + (t * (z * -9.0)))) else: tmp = 0.5 * (x * (y / a)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= 1e+262) tmp = Float64(0.5 / Float64(a / Float64(Float64(x * y) + Float64(t * Float64(z * -9.0))))); else tmp = Float64(0.5 * Float64(x * Float64(y / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= 1e+262)
tmp = 0.5 / (a / ((x * y) + (t * (z * -9.0))));
else
tmp = 0.5 * (x * (y / a));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], 1e+262], N[(0.5 / N[(a / N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq 10^{+262}:\\
\;\;\;\;\frac{0.5}{\frac{a}{x \cdot y + t \cdot \left(z \cdot -9\right)}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < 1e262Initial program 95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around 0 95.6%
associate-*r/95.6%
cancel-sign-sub-inv95.6%
metadata-eval95.6%
+-commutative95.6%
associate-/l*95.6%
+-commutative95.6%
metadata-eval95.6%
cancel-sign-sub-inv95.6%
fma-neg96.0%
*-commutative96.0%
distribute-lft-neg-in96.0%
metadata-eval96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.0%
Simplified96.0%
fma-udef95.6%
Applied egg-rr95.6%
if 1e262 < (*.f64 x y) Initial program 74.3%
*-commutative74.3%
*-commutative74.3%
associate-*l*74.3%
Simplified74.3%
Taylor expanded in x around inf 74.3%
associate-*r/99.8%
Simplified99.8%
Final simplification95.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) 1e+262) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (* 0.5 (* x (/ y a)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 1e+262) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
NOTE: x and y 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) <= 1d+262) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = 0.5d0 * (x * (y / a))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 1e+262) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= 1e+262: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = 0.5 * (x * (y / a)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= 1e+262) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(0.5 * Float64(x * Float64(y / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= 1e+262)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = 0.5 * (x * (y / a));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], 1e+262], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq 10^{+262}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < 1e262Initial program 95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.7%
Simplified95.7%
if 1e262 < (*.f64 x y) Initial program 74.3%
*-commutative74.3%
*-commutative74.3%
associate-*l*74.3%
Simplified74.3%
Taylor expanded in x around inf 74.3%
associate-*r/99.8%
Simplified99.8%
Final simplification96.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2000000000.0) (/ 0.5 (/ a (* x y))) (if (<= (* x y) 2e+90) (* -4.5 (/ (* z t) a)) (* 0.5 (* x (/ y a))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2000000000.0) {
tmp = 0.5 / (a / (x * y));
} else if ((x * y) <= 2e+90) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
NOTE: x and y 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) <= (-2000000000.0d0)) then
tmp = 0.5d0 / (a / (x * y))
else if ((x * y) <= 2d+90) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = 0.5d0 * (x * (y / a))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2000000000.0) {
tmp = 0.5 / (a / (x * y));
} else if ((x * y) <= 2e+90) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2000000000.0: tmp = 0.5 / (a / (x * y)) elif (x * y) <= 2e+90: tmp = -4.5 * ((z * t) / a) else: tmp = 0.5 * (x * (y / a)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2000000000.0) tmp = Float64(0.5 / Float64(a / Float64(x * y))); elseif (Float64(x * y) <= 2e+90) 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 = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2000000000.0)
tmp = 0.5 / (a / (x * y));
elseif ((x * y) <= 2e+90)
tmp = -4.5 * ((z * t) / a);
else
tmp = 0.5 * (x * (y / a));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2000000000.0], N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+90], 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] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2000000000:\\
\;\;\;\;\frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+90}:\\
\;\;\;\;-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) < -2e9Initial program 93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around 0 93.9%
associate-*r/93.9%
cancel-sign-sub-inv93.9%
metadata-eval93.9%
+-commutative93.9%
associate-/l*93.7%
+-commutative93.7%
metadata-eval93.7%
cancel-sign-sub-inv93.7%
fma-neg95.3%
*-commutative95.3%
distribute-lft-neg-in95.3%
metadata-eval95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in x around inf 78.8%
if -2e9 < (*.f64 x y) < 1.99999999999999993e90Initial program 96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 75.3%
if 1.99999999999999993e90 < (*.f64 x y) Initial program 84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in x around inf 80.1%
associate-*r/90.6%
Simplified90.6%
Final simplification78.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2000000000.0) (/ 0.5 (/ a (* x y))) (if (<= (* x y) 2e+90) (* -4.5 (/ (* z t) a)) (/ 0.5 (/ (/ a y) x)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2000000000.0) {
tmp = 0.5 / (a / (x * y));
} else if ((x * y) <= 2e+90) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 / ((a / y) / x);
}
return tmp;
}
NOTE: x and y 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) <= (-2000000000.0d0)) then
tmp = 0.5d0 / (a / (x * y))
else if ((x * y) <= 2d+90) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = 0.5d0 / ((a / y) / x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2000000000.0) {
tmp = 0.5 / (a / (x * y));
} else if ((x * y) <= 2e+90) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 / ((a / y) / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2000000000.0: tmp = 0.5 / (a / (x * y)) elif (x * y) <= 2e+90: tmp = -4.5 * ((z * t) / a) else: tmp = 0.5 / ((a / y) / x) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2000000000.0) tmp = Float64(0.5 / Float64(a / Float64(x * y))); elseif (Float64(x * y) <= 2e+90) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(0.5 / Float64(Float64(a / y) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2000000000.0)
tmp = 0.5 / (a / (x * y));
elseif ((x * y) <= 2e+90)
tmp = -4.5 * ((z * t) / a);
else
tmp = 0.5 / ((a / y) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2000000000.0], N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+90], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(N[(a / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2000000000:\\
\;\;\;\;\frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+90}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{\frac{a}{y}}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -2e9Initial program 93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around 0 93.9%
associate-*r/93.9%
cancel-sign-sub-inv93.9%
metadata-eval93.9%
+-commutative93.9%
associate-/l*93.7%
+-commutative93.7%
metadata-eval93.7%
cancel-sign-sub-inv93.7%
fma-neg95.3%
*-commutative95.3%
distribute-lft-neg-in95.3%
metadata-eval95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in x around inf 78.8%
if -2e9 < (*.f64 x y) < 1.99999999999999993e90Initial program 96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 75.3%
if 1.99999999999999993e90 < (*.f64 x y) Initial program 84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in a around 0 84.9%
associate-*r/84.9%
cancel-sign-sub-inv84.9%
metadata-eval84.9%
+-commutative84.9%
associate-/l*84.9%
+-commutative84.9%
metadata-eval84.9%
cancel-sign-sub-inv84.9%
fma-neg84.9%
*-commutative84.9%
distribute-lft-neg-in84.9%
metadata-eval84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in x around inf 80.1%
*-commutative80.1%
associate-/r*90.8%
Simplified90.8%
Final simplification78.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2000000000.0) (/ (* x (* y 0.5)) a) (if (<= (* x y) 2e+90) (* -4.5 (/ (* z t) a)) (/ 0.5 (/ (/ a y) x)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2000000000.0) {
tmp = (x * (y * 0.5)) / a;
} else if ((x * y) <= 2e+90) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 / ((a / y) / x);
}
return tmp;
}
NOTE: x and y 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) <= (-2000000000.0d0)) then
tmp = (x * (y * 0.5d0)) / a
else if ((x * y) <= 2d+90) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = 0.5d0 / ((a / y) / x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2000000000.0) {
tmp = (x * (y * 0.5)) / a;
} else if ((x * y) <= 2e+90) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 / ((a / y) / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2000000000.0: tmp = (x * (y * 0.5)) / a elif (x * y) <= 2e+90: tmp = -4.5 * ((z * t) / a) else: tmp = 0.5 / ((a / y) / x) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2000000000.0) tmp = Float64(Float64(x * Float64(y * 0.5)) / a); elseif (Float64(x * y) <= 2e+90) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(0.5 / Float64(Float64(a / y) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2000000000.0)
tmp = (x * (y * 0.5)) / a;
elseif ((x * y) <= 2e+90)
tmp = -4.5 * ((z * t) / a);
else
tmp = 0.5 / ((a / y) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2000000000.0], N[(N[(x * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+90], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(N[(a / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2000000000:\\
\;\;\;\;\frac{x \cdot \left(y \cdot 0.5\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+90}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{\frac{a}{y}}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -2e9Initial program 93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in a around 0 93.9%
associate-*r/93.9%
cancel-sign-sub-inv93.9%
metadata-eval93.9%
+-commutative93.9%
associate-/l*93.7%
+-commutative93.7%
metadata-eval93.7%
cancel-sign-sub-inv93.7%
fma-neg95.3%
*-commutative95.3%
distribute-lft-neg-in95.3%
metadata-eval95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*95.3%
Simplified95.3%
fma-udef93.7%
Applied egg-rr93.7%
Taylor expanded in x around inf 78.9%
*-commutative78.9%
associate-*l/78.9%
associate-*l*78.9%
Simplified78.9%
if -2e9 < (*.f64 x y) < 1.99999999999999993e90Initial program 96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 75.3%
if 1.99999999999999993e90 < (*.f64 x y) Initial program 84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in a around 0 84.9%
associate-*r/84.9%
cancel-sign-sub-inv84.9%
metadata-eval84.9%
+-commutative84.9%
associate-/l*84.9%
+-commutative84.9%
metadata-eval84.9%
cancel-sign-sub-inv84.9%
fma-neg84.9%
*-commutative84.9%
distribute-lft-neg-in84.9%
metadata-eval84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in x around inf 80.1%
*-commutative80.1%
associate-/r*90.8%
Simplified90.8%
Final simplification78.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.8e+81) (* -4.5 (/ z (/ a t))) (if (<= z 2.95e-33) (* 0.5 (* x (/ y a))) (* -4.5 (/ t (/ a z))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+81) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 2.95e-33) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
NOTE: x and y 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 (z <= (-2.8d+81)) then
tmp = (-4.5d0) * (z / (a / t))
else if (z <= 2.95d-33) then
tmp = 0.5d0 * (x * (y / a))
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+81) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 2.95e-33) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.8e+81: tmp = -4.5 * (z / (a / t)) elif z <= 2.95e-33: tmp = 0.5 * (x * (y / a)) else: tmp = -4.5 * (t / (a / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+81) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (z <= 2.95e-33) tmp = Float64(0.5 * Float64(x * Float64(y / a))); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.8e+81)
tmp = -4.5 * (z / (a / t));
elseif (z <= 2.95e-33)
tmp = 0.5 * (x * (y / a));
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+81], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.95e-33], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+81}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{-33}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if z < -2.79999999999999995e81Initial program 91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 80.8%
associate-/l*77.0%
Simplified77.0%
associate-/r/82.9%
Applied egg-rr82.9%
*-commutative82.9%
clear-num83.0%
un-div-inv83.0%
Applied egg-rr83.0%
if -2.79999999999999995e81 < z < 2.94999999999999993e-33Initial program 95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 63.8%
associate-*r/63.0%
Simplified63.0%
if 2.94999999999999993e-33 < z Initial program 90.6%
*-commutative90.6%
*-commutative90.6%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in x around 0 53.7%
associate-/l*55.2%
Simplified55.2%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.3e+80) (* -4.5 (/ z (/ a t))) (if (<= z 1.12e-32) (* 0.5 (/ x (/ a y))) (* -4.5 (/ t (/ a z))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+80) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 1.12e-32) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
NOTE: x and y 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 (z <= (-2.3d+80)) then
tmp = (-4.5d0) * (z / (a / t))
else if (z <= 1.12d-32) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+80) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 1.12e-32) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+80: tmp = -4.5 * (z / (a / t)) elif z <= 1.12e-32: tmp = 0.5 * (x / (a / y)) else: tmp = -4.5 * (t / (a / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+80) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (z <= 1.12e-32) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.3e+80)
tmp = -4.5 * (z / (a / t));
elseif (z <= 1.12e-32)
tmp = 0.5 * (x / (a / y));
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+80], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e-32], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+80}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-32}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if z < -2.30000000000000004e80Initial program 91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 80.8%
associate-/l*77.0%
Simplified77.0%
associate-/r/82.9%
Applied egg-rr82.9%
*-commutative82.9%
clear-num83.0%
un-div-inv83.0%
Applied egg-rr83.0%
if -2.30000000000000004e80 < z < 1.12e-32Initial program 95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 63.8%
associate-/l*63.0%
Simplified63.0%
if 1.12e-32 < z Initial program 90.6%
*-commutative90.6%
*-commutative90.6%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in x around 0 53.7%
associate-/l*55.2%
Simplified55.2%
Final simplification64.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.3e+80) (* -4.5 (/ z (/ a t))) (if (<= z 8e-34) (* 0.5 (/ x (/ a y))) (* z (* -4.5 (/ t a))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+80) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 8e-34) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = z * (-4.5 * (t / a));
}
return tmp;
}
NOTE: x and y 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 (z <= (-2.3d+80)) then
tmp = (-4.5d0) * (z / (a / t))
else if (z <= 8d-34) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = z * ((-4.5d0) * (t / a))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+80) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 8e-34) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = z * (-4.5 * (t / a));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+80: tmp = -4.5 * (z / (a / t)) elif z <= 8e-34: tmp = 0.5 * (x / (a / y)) else: tmp = z * (-4.5 * (t / a)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+80) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (z <= 8e-34) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = Float64(z * Float64(-4.5 * Float64(t / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.3e+80)
tmp = -4.5 * (z / (a / t));
elseif (z <= 8e-34)
tmp = 0.5 * (x / (a / y));
else
tmp = z * (-4.5 * (t / a));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+80], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-34], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+80}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-34}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if z < -2.30000000000000004e80Initial program 91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 80.8%
associate-/l*77.0%
Simplified77.0%
associate-/r/82.9%
Applied egg-rr82.9%
*-commutative82.9%
clear-num83.0%
un-div-inv83.0%
Applied egg-rr83.0%
if -2.30000000000000004e80 < z < 7.99999999999999942e-34Initial program 95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 63.8%
associate-/l*63.0%
Simplified63.0%
if 7.99999999999999942e-34 < z Initial program 90.6%
*-commutative90.6%
*-commutative90.6%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in x around 0 53.7%
associate-/l*55.2%
Simplified55.2%
associate-*r/55.1%
associate-/l*55.1%
associate-/l/53.6%
Applied egg-rr53.6%
associate-/r*58.0%
associate-/r/58.0%
un-div-inv58.0%
clear-num58.1%
*-commutative58.1%
Applied egg-rr58.1%
Final simplification65.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.8e+81) (* -4.5 (/ z (/ a t))) (if (<= z 3.1e-32) (* 0.5 (/ x (/ a y))) (* z (/ t (/ a -4.5))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+81) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 3.1e-32) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = z * (t / (a / -4.5));
}
return tmp;
}
NOTE: x and y 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 (z <= (-2.8d+81)) then
tmp = (-4.5d0) * (z / (a / t))
else if (z <= 3.1d-32) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = z * (t / (a / (-4.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+81) {
tmp = -4.5 * (z / (a / t));
} else if (z <= 3.1e-32) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = z * (t / (a / -4.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.8e+81: tmp = -4.5 * (z / (a / t)) elif z <= 3.1e-32: tmp = 0.5 * (x / (a / y)) else: tmp = z * (t / (a / -4.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+81) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (z <= 3.1e-32) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = Float64(z * Float64(t / Float64(a / -4.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.8e+81)
tmp = -4.5 * (z / (a / t));
elseif (z <= 3.1e-32)
tmp = 0.5 * (x / (a / y));
else
tmp = z * (t / (a / -4.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+81], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e-32], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t / N[(a / -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+81}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-32}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{t}{\frac{a}{-4.5}}\\
\end{array}
\end{array}
if z < -2.79999999999999995e81Initial program 91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 80.8%
associate-/l*77.0%
Simplified77.0%
associate-/r/82.9%
Applied egg-rr82.9%
*-commutative82.9%
clear-num83.0%
un-div-inv83.0%
Applied egg-rr83.0%
if -2.79999999999999995e81 < z < 3.10000000000000011e-32Initial program 95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 63.8%
associate-/l*63.0%
Simplified63.0%
if 3.10000000000000011e-32 < z Initial program 90.6%
*-commutative90.6%
*-commutative90.6%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in x around 0 53.7%
associate-/l*55.2%
associate-*r/55.1%
Simplified55.1%
associate-/r/58.1%
*-commutative58.1%
associate-/l*58.1%
Applied egg-rr58.1%
Final simplification65.4%
NOTE: x and y 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);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
NOTE: x and y 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;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return -4.5 * (z * (t / a))
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(z * Float64(t / a))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (z * (t / a));
end
NOTE: x and y 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] = \mathsf{sort}([x, y])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in x around 0 52.2%
associate-/l*50.3%
Simplified50.3%
associate-/r/53.6%
Applied egg-rr53.6%
Final simplification53.6%
(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 2023320
(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)))