
(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 12 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.
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) (* (* z 9.0) t))))
(if (or (<= t_1 -5e+293) (not (<= t_1 5e+192)))
(fma 0.5 (* x (/ y a)) (* -4.5 (* z (/ t a))))
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -5e+293) || !(t_1 <= 5e+192)) {
tmp = fma(0.5, (x * (y / a)), (-4.5 * (z * (t / a))));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) tmp = 0.0 if ((t_1 <= -5e+293) || !(t_1 <= 5e+192)) tmp = fma(0.5, Float64(x * Float64(y / a)), Float64(-4.5 * Float64(z * Float64(t / a)))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+293], N[Not[LessEqual[t$95$1, 5e+192]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] + N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+293} \lor \neg \left(t_1 \leq 5 \cdot 10^{+192}\right):\\
\;\;\;\;\mathsf{fma}\left(0.5, x \cdot \frac{y}{a}, -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -5.00000000000000033e293 or 5.00000000000000033e192 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 78.5%
sub-neg78.5%
+-commutative78.5%
neg-sub078.5%
associate-+l-78.5%
sub0-neg78.5%
neg-mul-178.5%
associate-/l*78.5%
associate-/r/78.5%
*-commutative78.5%
sub-neg78.5%
+-commutative78.5%
neg-sub078.5%
associate-+l-78.5%
sub0-neg78.5%
distribute-lft-neg-out78.5%
distribute-rgt-neg-in78.5%
Simplified78.5%
fma-udef78.5%
*-commutative78.5%
metadata-eval78.5%
distribute-lft-neg-in78.5%
distribute-rgt-neg-in78.5%
+-commutative78.5%
distribute-rgt-neg-in78.5%
distribute-lft-neg-in78.5%
metadata-eval78.5%
*-commutative78.5%
Applied egg-rr78.5%
Taylor expanded in z around 0 74.5%
+-commutative74.5%
*-commutative74.5%
fma-def74.5%
associate-/l*83.6%
associate-/r/83.6%
*-commutative83.6%
associate-/l*93.0%
associate-/r/93.9%
Simplified93.9%
if -5.00000000000000033e293 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 5.00000000000000033e192Initial program 98.9%
associate-*l*98.9%
Simplified98.9%
Final simplification96.9%
NOTE: x and y should be sorted in increasing order before calling this function.
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 (* (* z 9.0) t)))
(if (<= t_1 (- INFINITY))
(* -4.5 (* z (/ t a)))
(if (<= t_1 2e+224)
(/ (- (* x y) t_1) (* a 2.0))
(* -4.5 (/ t (/ a z)))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = -4.5 * (z * (t / a));
} else if (t_1 <= 2e+224) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = -4.5 * (z * (t / a));
} else if (t_1 <= 2e+224) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (z * 9.0) * t tmp = 0 if t_1 <= -math.inf: tmp = -4.5 * (z * (t / a)) elif t_1 <= 2e+224: tmp = ((x * y) - t_1) / (a * 2.0) else: tmp = -4.5 * (t / (a / z)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(z * 9.0) * t) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); elseif (t_1 <= 2e+224) tmp = Float64(Float64(Float64(x * y) - t_1) / Float64(a * 2.0)); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (z * 9.0) * t;
tmp = 0.0;
if (t_1 <= -Inf)
tmp = -4.5 * (z * (t / a));
elseif (t_1 <= 2e+224)
tmp = ((x * y) - t_1) / (a * 2.0);
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.
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[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+224], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;\frac{x \cdot y - t_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z 9) t) < -inf.0Initial program 60.9%
sub-neg60.9%
+-commutative60.9%
neg-sub060.9%
associate-+l-60.9%
sub0-neg60.9%
neg-mul-160.9%
associate-/l*60.9%
associate-/r/60.9%
*-commutative60.9%
sub-neg60.9%
+-commutative60.9%
neg-sub060.9%
associate-+l-60.9%
sub0-neg60.9%
distribute-lft-neg-out60.9%
distribute-rgt-neg-in60.9%
Simplified60.9%
Taylor expanded in x around 0 60.9%
associate-/l*99.8%
Simplified99.8%
associate-/r/99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 (*.f64 z 9) t) < 1.99999999999999994e224Initial program 94.5%
if 1.99999999999999994e224 < (*.f64 (*.f64 z 9) t) Initial program 78.3%
sub-neg78.3%
+-commutative78.3%
neg-sub078.3%
associate-+l-78.3%
sub0-neg78.3%
neg-mul-178.3%
associate-/l*78.3%
associate-/r/78.2%
*-commutative78.2%
sub-neg78.2%
+-commutative78.2%
neg-sub078.2%
associate-+l-78.2%
sub0-neg78.2%
distribute-lft-neg-out78.2%
distribute-rgt-neg-in78.2%
Simplified78.2%
Taylor expanded in x around 0 82.7%
associate-/l*99.9%
Simplified99.9%
Final simplification95.3%
NOTE: x and y should be sorted in increasing order before calling this function.
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 (* 0.5 (/ y (/ a x)))))
(if (<= y -1.6e-90)
t_1
(if (<= y 7.5e-292)
(* -4.5 (/ (* z t) a))
(if (<= y 7.6e+65) (* -4.5 (* z (/ t a))) t_1)))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (y / (a / x));
double tmp;
if (y <= -1.6e-90) {
tmp = t_1;
} else if (y <= 7.5e-292) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 7.6e+65) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = 0.5d0 * (y / (a / x))
if (y <= (-1.6d-90)) then
tmp = t_1
else if (y <= 7.5d-292) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 7.6d+65) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (y / (a / x));
double tmp;
if (y <= -1.6e-90) {
tmp = t_1;
} else if (y <= 7.5e-292) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 7.6e+65) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = 0.5 * (y / (a / x)) tmp = 0 if y <= -1.6e-90: tmp = t_1 elif y <= 7.5e-292: tmp = -4.5 * ((z * t) / a) elif y <= 7.6e+65: tmp = -4.5 * (z * (t / a)) else: tmp = t_1 return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(0.5 * Float64(y / Float64(a / x))) tmp = 0.0 if (y <= -1.6e-90) tmp = t_1; elseif (y <= 7.5e-292) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 7.6e+65) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 0.5 * (y / (a / x));
tmp = 0.0;
if (y <= -1.6e-90)
tmp = t_1;
elseif (y <= 7.5e-292)
tmp = -4.5 * ((z * t) / a);
elseif (y <= 7.6e+65)
tmp = -4.5 * (z * (t / a));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e-90], t$95$1, If[LessEqual[y, 7.5e-292], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e+65], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-292}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+65}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.60000000000000004e-90 or 7.60000000000000022e65 < y Initial program 90.6%
sub-neg90.6%
+-commutative90.6%
neg-sub090.6%
associate-+l-90.6%
sub0-neg90.6%
neg-mul-190.6%
associate-/l*90.5%
associate-/r/90.5%
*-commutative90.5%
sub-neg90.5%
+-commutative90.5%
neg-sub090.5%
associate-+l-90.5%
sub0-neg90.5%
distribute-lft-neg-out90.5%
distribute-rgt-neg-in90.5%
Simplified90.6%
associate-*r/90.6%
clear-num90.5%
*-commutative90.5%
Applied egg-rr90.5%
Taylor expanded in x around inf 58.6%
associate-/l*62.5%
Simplified62.5%
if -1.60000000000000004e-90 < y < 7.5000000000000002e-292Initial program 91.9%
sub-neg91.9%
+-commutative91.9%
neg-sub091.9%
associate-+l-91.9%
sub0-neg91.9%
neg-mul-191.9%
associate-/l*91.9%
associate-/r/91.9%
*-commutative91.9%
sub-neg91.9%
+-commutative91.9%
neg-sub091.9%
associate-+l-91.9%
sub0-neg91.9%
distribute-lft-neg-out91.9%
distribute-rgt-neg-in91.9%
Simplified91.9%
Taylor expanded in x around 0 74.9%
if 7.5000000000000002e-292 < y < 7.60000000000000022e65Initial program 90.7%
sub-neg90.7%
+-commutative90.7%
neg-sub090.7%
associate-+l-90.7%
sub0-neg90.7%
neg-mul-190.7%
associate-/l*90.6%
associate-/r/90.6%
*-commutative90.6%
sub-neg90.6%
+-commutative90.6%
neg-sub090.6%
associate-+l-90.6%
sub0-neg90.6%
distribute-lft-neg-out90.6%
distribute-rgt-neg-in90.6%
Simplified90.4%
Taylor expanded in x around 0 61.6%
associate-/l*67.5%
Simplified67.5%
associate-/r/66.7%
Applied egg-rr66.7%
Final simplification66.0%
NOTE: x and y should be sorted in increasing order before calling this function.
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 (* y (/ (* x 0.5) a))))
(if (<= y -4.8e-66)
t_1
(if (<= y 1e-291)
(* -4.5 (/ (* z t) a))
(if (<= y 7.5e+64) (* -4.5 (* z (/ t a))) t_1)))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((x * 0.5) / a);
double tmp;
if (y <= -4.8e-66) {
tmp = t_1;
} else if (y <= 1e-291) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 7.5e+64) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = y * ((x * 0.5d0) / a)
if (y <= (-4.8d-66)) then
tmp = t_1
else if (y <= 1d-291) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 7.5d+64) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((x * 0.5) / a);
double tmp;
if (y <= -4.8e-66) {
tmp = t_1;
} else if (y <= 1e-291) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 7.5e+64) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = y * ((x * 0.5) / a) tmp = 0 if y <= -4.8e-66: tmp = t_1 elif y <= 1e-291: tmp = -4.5 * ((z * t) / a) elif y <= 7.5e+64: tmp = -4.5 * (z * (t / a)) else: tmp = t_1 return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(x * 0.5) / a)) tmp = 0.0 if (y <= -4.8e-66) tmp = t_1; elseif (y <= 1e-291) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 7.5e+64) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * ((x * 0.5) / a);
tmp = 0.0;
if (y <= -4.8e-66)
tmp = t_1;
elseif (y <= 1e-291)
tmp = -4.5 * ((z * t) / a);
elseif (y <= 7.5e+64)
tmp = -4.5 * (z * (t / a));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-66], t$95$1, If[LessEqual[y, 1e-291], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+64], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 10^{-291}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+64}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.80000000000000052e-66 or 7.5000000000000005e64 < y Initial program 90.3%
sub-neg90.3%
+-commutative90.3%
neg-sub090.3%
associate-+l-90.3%
sub0-neg90.3%
neg-mul-190.3%
associate-/l*90.2%
associate-/r/90.2%
*-commutative90.2%
sub-neg90.2%
+-commutative90.2%
neg-sub090.2%
associate-+l-90.2%
sub0-neg90.2%
distribute-lft-neg-out90.2%
distribute-rgt-neg-in90.2%
Simplified90.3%
Taylor expanded in x around inf 57.8%
associate-*r/57.8%
*-commutative57.8%
associate-*l/57.8%
associate-*r*62.4%
*-commutative62.4%
associate-*l/62.5%
Simplified62.5%
if -4.80000000000000052e-66 < y < 9.99999999999999962e-292Initial program 92.5%
sub-neg92.5%
+-commutative92.5%
neg-sub092.5%
associate-+l-92.5%
sub0-neg92.5%
neg-mul-192.5%
associate-/l*92.6%
associate-/r/92.6%
*-commutative92.6%
sub-neg92.6%
+-commutative92.6%
neg-sub092.6%
associate-+l-92.6%
sub0-neg92.6%
distribute-lft-neg-out92.6%
distribute-rgt-neg-in92.6%
Simplified92.5%
Taylor expanded in x around 0 70.2%
if 9.99999999999999962e-292 < y < 7.5000000000000005e64Initial program 90.7%
sub-neg90.7%
+-commutative90.7%
neg-sub090.7%
associate-+l-90.7%
sub0-neg90.7%
neg-mul-190.7%
associate-/l*90.6%
associate-/r/90.6%
*-commutative90.6%
sub-neg90.6%
+-commutative90.6%
neg-sub090.6%
associate-+l-90.6%
sub0-neg90.6%
distribute-lft-neg-out90.6%
distribute-rgt-neg-in90.6%
Simplified90.4%
Taylor expanded in x around 0 61.6%
associate-/l*67.5%
Simplified67.5%
associate-/r/66.7%
Applied egg-rr66.7%
Final simplification65.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= y -3e-66)
(* (/ y a) (* x 0.5))
(if (<= y 1.35e-291)
(* -4.5 (/ (* z t) a))
(if (<= y 9.5e+63) (* -4.5 (* z (/ t a))) (* y (/ (* x 0.5) a))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3e-66) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 1.35e-291) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 9.5e+63) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = y * ((x * 0.5) / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (y <= (-3d-66)) then
tmp = (y / a) * (x * 0.5d0)
else if (y <= 1.35d-291) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 9.5d+63) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = y * ((x * 0.5d0) / a)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3e-66) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 1.35e-291) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 9.5e+63) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = y * ((x * 0.5) / a);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if y <= -3e-66: tmp = (y / a) * (x * 0.5) elif y <= 1.35e-291: tmp = -4.5 * ((z * t) / a) elif y <= 9.5e+63: tmp = -4.5 * (z * (t / a)) else: tmp = y * ((x * 0.5) / a) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= -3e-66) tmp = Float64(Float64(y / a) * Float64(x * 0.5)); elseif (y <= 1.35e-291) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 9.5e+63) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(y * Float64(Float64(x * 0.5) / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (y <= -3e-66)
tmp = (y / a) * (x * 0.5);
elseif (y <= 1.35e-291)
tmp = -4.5 * ((z * t) / a);
elseif (y <= 9.5e+63)
tmp = -4.5 * (z * (t / a));
else
tmp = y * ((x * 0.5) / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3e-66], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-291], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+63], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-291}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+63}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\end{array}
\end{array}
if y < -3.0000000000000002e-66Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*94.1%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
associate-*r/94.1%
clear-num94.1%
*-commutative94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 52.5%
*-commutative52.5%
*-commutative52.5%
associate-/l*55.8%
associate-*l/55.8%
Simplified55.8%
div-inv55.8%
Applied egg-rr55.8%
Taylor expanded in a around 0 56.6%
if -3.0000000000000002e-66 < y < 1.34999999999999996e-291Initial program 92.5%
sub-neg92.5%
+-commutative92.5%
neg-sub092.5%
associate-+l-92.5%
sub0-neg92.5%
neg-mul-192.5%
associate-/l*92.6%
associate-/r/92.6%
*-commutative92.6%
sub-neg92.6%
+-commutative92.6%
neg-sub092.6%
associate-+l-92.6%
sub0-neg92.6%
distribute-lft-neg-out92.6%
distribute-rgt-neg-in92.6%
Simplified92.5%
Taylor expanded in x around 0 70.2%
if 1.34999999999999996e-291 < y < 9.5000000000000003e63Initial program 90.7%
sub-neg90.7%
+-commutative90.7%
neg-sub090.7%
associate-+l-90.7%
sub0-neg90.7%
neg-mul-190.7%
associate-/l*90.6%
associate-/r/90.6%
*-commutative90.6%
sub-neg90.6%
+-commutative90.6%
neg-sub090.6%
associate-+l-90.6%
sub0-neg90.6%
distribute-lft-neg-out90.6%
distribute-rgt-neg-in90.6%
Simplified90.4%
Taylor expanded in x around 0 61.6%
associate-/l*67.5%
Simplified67.5%
associate-/r/66.7%
Applied egg-rr66.7%
if 9.5000000000000003e63 < y Initial program 84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
neg-mul-184.7%
associate-/l*84.5%
associate-/r/84.7%
*-commutative84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
distribute-lft-neg-out84.7%
distribute-rgt-neg-in84.7%
Simplified84.7%
Taylor expanded in x around inf 65.6%
associate-*r/65.6%
*-commutative65.6%
associate-*l/65.6%
associate-*r*73.5%
*-commutative73.5%
associate-*l/73.6%
Simplified73.6%
Final simplification65.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= y -3.7e-66)
(* (/ y a) (* x 0.5))
(if (<= y 4.5e-291)
(* -4.5 (/ (* z t) a))
(if (<= y 1.22e+64) (* -4.5 (* z (/ t a))) (* (/ x a) (/ y 2.0))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.7e-66) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 4.5e-291) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.22e+64) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (y <= (-3.7d-66)) then
tmp = (y / a) * (x * 0.5d0)
else if (y <= 4.5d-291) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 1.22d+64) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = (x / a) * (y / 2.0d0)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.7e-66) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 4.5e-291) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.22e+64) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if y <= -3.7e-66: tmp = (y / a) * (x * 0.5) elif y <= 4.5e-291: tmp = -4.5 * ((z * t) / a) elif y <= 1.22e+64: tmp = -4.5 * (z * (t / a)) else: tmp = (x / a) * (y / 2.0) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.7e-66) tmp = Float64(Float64(y / a) * Float64(x * 0.5)); elseif (y <= 4.5e-291) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 1.22e+64) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(Float64(x / a) * Float64(y / 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (y <= -3.7e-66)
tmp = (y / a) * (x * 0.5);
elseif (y <= 4.5e-291)
tmp = -4.5 * ((z * t) / a);
elseif (y <= 1.22e+64)
tmp = -4.5 * (z * (t / a));
else
tmp = (x / a) * (y / 2.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.7e-66], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-291], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.22e+64], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-291}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+64}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\
\end{array}
\end{array}
if y < -3.7000000000000002e-66Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*94.1%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
associate-*r/94.1%
clear-num94.1%
*-commutative94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 52.5%
*-commutative52.5%
*-commutative52.5%
associate-/l*55.8%
associate-*l/55.8%
Simplified55.8%
div-inv55.8%
Applied egg-rr55.8%
Taylor expanded in a around 0 56.6%
if -3.7000000000000002e-66 < y < 4.49999999999999974e-291Initial program 92.5%
sub-neg92.5%
+-commutative92.5%
neg-sub092.5%
associate-+l-92.5%
sub0-neg92.5%
neg-mul-192.5%
associate-/l*92.6%
associate-/r/92.6%
*-commutative92.6%
sub-neg92.6%
+-commutative92.6%
neg-sub092.6%
associate-+l-92.6%
sub0-neg92.6%
distribute-lft-neg-out92.6%
distribute-rgt-neg-in92.6%
Simplified92.5%
Taylor expanded in x around 0 70.2%
if 4.49999999999999974e-291 < y < 1.21999999999999994e64Initial program 90.7%
sub-neg90.7%
+-commutative90.7%
neg-sub090.7%
associate-+l-90.7%
sub0-neg90.7%
neg-mul-190.7%
associate-/l*90.6%
associate-/r/90.6%
*-commutative90.6%
sub-neg90.6%
+-commutative90.6%
neg-sub090.6%
associate-+l-90.6%
sub0-neg90.6%
distribute-lft-neg-out90.6%
distribute-rgt-neg-in90.6%
Simplified90.4%
Taylor expanded in x around 0 61.6%
associate-/l*67.5%
Simplified67.5%
associate-/r/66.7%
Applied egg-rr66.7%
if 1.21999999999999994e64 < y Initial program 84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
neg-mul-184.7%
associate-/l*84.5%
associate-/r/84.7%
*-commutative84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
distribute-lft-neg-out84.7%
distribute-rgt-neg-in84.7%
Simplified84.7%
associate-*r/84.8%
associate-/l*84.8%
div-inv84.8%
metadata-eval84.8%
*-commutative84.8%
metadata-eval84.8%
distribute-lft-neg-in84.8%
distribute-rgt-neg-in84.8%
fma-neg84.8%
add-sqr-sqrt36.0%
associate-/r*36.0%
fma-neg36.0%
distribute-rgt-neg-in36.0%
distribute-lft-neg-in36.0%
metadata-eval36.0%
*-commutative36.0%
Applied egg-rr36.0%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
unpow265.2%
rem-square-sqrt65.6%
*-commutative65.6%
times-frac73.6%
Simplified73.6%
Final simplification65.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* (+ (* x y) (* z (* t -9.0))) (/ 0.5 a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return ((x * y) + (z * (t * -9.0))) * (0.5 / a);
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = ((x * y) + (z * (t * (-9.0d0)))) * (0.5d0 / a)
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) + (z * (t * -9.0))) * (0.5 / a);
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return ((x * y) + (z * (t * -9.0))) * (0.5 / a)
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t * -9.0))) * Float64(0.5 / a)) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = ((x * y) + (z * (t * -9.0))) * (0.5 / a);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\left(x \cdot y + z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}
\end{array}
Initial program 90.9%
sub-neg90.9%
+-commutative90.9%
neg-sub090.9%
associate-+l-90.9%
sub0-neg90.9%
neg-mul-190.9%
associate-/l*90.8%
associate-/r/90.8%
*-commutative90.8%
sub-neg90.8%
+-commutative90.8%
neg-sub090.8%
associate-+l-90.8%
sub0-neg90.8%
distribute-lft-neg-out90.8%
distribute-rgt-neg-in90.8%
Simplified90.8%
fma-udef90.8%
*-commutative90.8%
metadata-eval90.8%
distribute-lft-neg-in90.8%
distribute-rgt-neg-in90.8%
+-commutative90.8%
distribute-rgt-neg-in90.8%
distribute-lft-neg-in90.8%
metadata-eval90.8%
*-commutative90.8%
Applied egg-rr90.8%
Final simplification90.8%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return ((x * y) - (z * (9.0 * t))) / (a * 2.0)
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}
\end{array}
Initial program 90.9%
associate-*l*90.9%
Simplified90.9%
Final simplification90.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= y -5e-66) (* (/ y a) (* x 0.5)) (if (<= y 6.6e+63) (* -4.5 (/ z (/ a t))) (* (/ x a) (/ y 2.0)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e-66) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 6.6e+63) {
tmp = -4.5 * (z / (a / t));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (y <= (-5d-66)) then
tmp = (y / a) * (x * 0.5d0)
else if (y <= 6.6d+63) then
tmp = (-4.5d0) * (z / (a / t))
else
tmp = (x / a) * (y / 2.0d0)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e-66) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 6.6e+63) {
tmp = -4.5 * (z / (a / t));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if y <= -5e-66: tmp = (y / a) * (x * 0.5) elif y <= 6.6e+63: tmp = -4.5 * (z / (a / t)) else: tmp = (x / a) * (y / 2.0) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= -5e-66) tmp = Float64(Float64(y / a) * Float64(x * 0.5)); elseif (y <= 6.6e+63) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); else tmp = Float64(Float64(x / a) * Float64(y / 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (y <= -5e-66)
tmp = (y / a) * (x * 0.5);
elseif (y <= 6.6e+63)
tmp = -4.5 * (z / (a / t));
else
tmp = (x / a) * (y / 2.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5e-66], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+63], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-66}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+63}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\
\end{array}
\end{array}
if y < -4.99999999999999962e-66Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*94.1%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
associate-*r/94.1%
clear-num94.1%
*-commutative94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 52.5%
*-commutative52.5%
*-commutative52.5%
associate-/l*55.8%
associate-*l/55.8%
Simplified55.8%
div-inv55.8%
Applied egg-rr55.8%
Taylor expanded in a around 0 56.6%
if -4.99999999999999962e-66 < y < 6.6000000000000003e63Initial program 91.6%
sub-neg91.6%
+-commutative91.6%
neg-sub091.6%
associate-+l-91.6%
sub0-neg91.6%
neg-mul-191.6%
associate-/l*91.5%
associate-/r/91.5%
*-commutative91.5%
sub-neg91.5%
+-commutative91.5%
neg-sub091.5%
associate-+l-91.5%
sub0-neg91.5%
distribute-lft-neg-out91.5%
distribute-rgt-neg-in91.5%
Simplified91.4%
fma-udef91.4%
*-commutative91.4%
metadata-eval91.4%
distribute-lft-neg-in91.4%
distribute-rgt-neg-in91.4%
+-commutative91.4%
distribute-rgt-neg-in91.4%
distribute-lft-neg-in91.4%
metadata-eval91.4%
*-commutative91.4%
Applied egg-rr91.4%
Taylor expanded in z around 0 92.5%
+-commutative92.5%
*-commutative92.5%
fma-def92.5%
associate-/l*87.0%
associate-/r/89.0%
*-commutative89.0%
associate-/l*91.4%
associate-/r/91.2%
Simplified91.2%
Taylor expanded in y around 0 65.6%
associate-*l/69.3%
*-commutative69.3%
*-commutative69.3%
associate-*r/65.6%
associate-/l*68.8%
Simplified68.8%
if 6.6000000000000003e63 < y Initial program 84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
neg-mul-184.7%
associate-/l*84.5%
associate-/r/84.7%
*-commutative84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
distribute-lft-neg-out84.7%
distribute-rgt-neg-in84.7%
Simplified84.7%
associate-*r/84.8%
associate-/l*84.8%
div-inv84.8%
metadata-eval84.8%
*-commutative84.8%
metadata-eval84.8%
distribute-lft-neg-in84.8%
distribute-rgt-neg-in84.8%
fma-neg84.8%
add-sqr-sqrt36.0%
associate-/r*36.0%
fma-neg36.0%
distribute-rgt-neg-in36.0%
distribute-lft-neg-in36.0%
metadata-eval36.0%
*-commutative36.0%
Applied egg-rr36.0%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
unpow265.2%
rem-square-sqrt65.6%
*-commutative65.6%
times-frac73.6%
Simplified73.6%
Final simplification65.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= y -1.7e-90) (/ (* x 0.5) (/ a y)) (if (<= y 7e+63) (* -4.5 (/ z (/ a t))) (* (/ x a) (/ y 2.0)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.7e-90) {
tmp = (x * 0.5) / (a / y);
} else if (y <= 7e+63) {
tmp = -4.5 * (z / (a / t));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (y <= (-1.7d-90)) then
tmp = (x * 0.5d0) / (a / y)
else if (y <= 7d+63) then
tmp = (-4.5d0) * (z / (a / t))
else
tmp = (x / a) * (y / 2.0d0)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.7e-90) {
tmp = (x * 0.5) / (a / y);
} else if (y <= 7e+63) {
tmp = -4.5 * (z / (a / t));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if y <= -1.7e-90: tmp = (x * 0.5) / (a / y) elif y <= 7e+63: tmp = -4.5 * (z / (a / t)) else: tmp = (x / a) * (y / 2.0) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.7e-90) tmp = Float64(Float64(x * 0.5) / Float64(a / y)); elseif (y <= 7e+63) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); else tmp = Float64(Float64(x / a) * Float64(y / 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (y <= -1.7e-90)
tmp = (x * 0.5) / (a / y);
elseif (y <= 7e+63)
tmp = -4.5 * (z / (a / t));
else
tmp = (x / a) * (y / 2.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.7e-90], N[(N[(x * 0.5), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+63], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-90}:\\
\;\;\;\;\frac{x \cdot 0.5}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+63}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\
\end{array}
\end{array}
if y < -1.69999999999999997e-90Initial program 94.4%
sub-neg94.4%
+-commutative94.4%
neg-sub094.4%
associate-+l-94.4%
sub0-neg94.4%
neg-mul-194.4%
associate-/l*94.4%
associate-/r/94.3%
*-commutative94.3%
sub-neg94.3%
+-commutative94.3%
neg-sub094.3%
associate-+l-94.3%
sub0-neg94.3%
distribute-lft-neg-out94.3%
distribute-rgt-neg-in94.3%
Simplified94.3%
associate-*r/94.4%
clear-num94.4%
*-commutative94.4%
Applied egg-rr94.4%
Taylor expanded in x around inf 54.1%
*-commutative54.1%
*-commutative54.1%
associate-/l*56.1%
associate-*l/56.1%
Simplified56.1%
if -1.69999999999999997e-90 < y < 7.00000000000000059e63Initial program 91.2%
sub-neg91.2%
+-commutative91.2%
neg-sub091.2%
associate-+l-91.2%
sub0-neg91.2%
neg-mul-191.2%
associate-/l*91.2%
associate-/r/91.2%
*-commutative91.2%
sub-neg91.2%
+-commutative91.2%
neg-sub091.2%
associate-+l-91.2%
sub0-neg91.2%
distribute-lft-neg-out91.2%
distribute-rgt-neg-in91.2%
Simplified91.1%
fma-udef91.1%
*-commutative91.1%
metadata-eval91.1%
distribute-lft-neg-in91.1%
distribute-rgt-neg-in91.1%
+-commutative91.1%
distribute-rgt-neg-in91.1%
distribute-lft-neg-in91.1%
metadata-eval91.1%
*-commutative91.1%
Applied egg-rr91.1%
Taylor expanded in z around 0 92.2%
+-commutative92.2%
*-commutative92.2%
fma-def92.2%
associate-/l*86.4%
associate-/r/89.4%
*-commutative89.4%
associate-/l*92.7%
associate-/r/91.7%
Simplified91.7%
Taylor expanded in y around 0 67.5%
associate-*l/71.3%
*-commutative71.3%
*-commutative71.3%
associate-*r/67.5%
associate-/l*70.8%
Simplified70.8%
if 7.00000000000000059e63 < y Initial program 84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
neg-mul-184.7%
associate-/l*84.5%
associate-/r/84.7%
*-commutative84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
distribute-lft-neg-out84.7%
distribute-rgt-neg-in84.7%
Simplified84.7%
associate-*r/84.8%
associate-/l*84.8%
div-inv84.8%
metadata-eval84.8%
*-commutative84.8%
metadata-eval84.8%
distribute-lft-neg-in84.8%
distribute-rgt-neg-in84.8%
fma-neg84.8%
add-sqr-sqrt36.0%
associate-/r*36.0%
fma-neg36.0%
distribute-rgt-neg-in36.0%
distribute-lft-neg-in36.0%
metadata-eval36.0%
*-commutative36.0%
Applied egg-rr36.0%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
unpow265.2%
rem-square-sqrt65.6%
*-commutative65.6%
times-frac73.6%
Simplified73.6%
Final simplification66.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= y -4.6e-66) (* (* x 0.5) (/ 1.0 (/ a y))) (if (<= y 3e+64) (* -4.5 (/ z (/ a t))) (* (/ x a) (/ y 2.0)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e-66) {
tmp = (x * 0.5) * (1.0 / (a / y));
} else if (y <= 3e+64) {
tmp = -4.5 * (z / (a / t));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (y <= (-4.6d-66)) then
tmp = (x * 0.5d0) * (1.0d0 / (a / y))
else if (y <= 3d+64) then
tmp = (-4.5d0) * (z / (a / t))
else
tmp = (x / a) * (y / 2.0d0)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e-66) {
tmp = (x * 0.5) * (1.0 / (a / y));
} else if (y <= 3e+64) {
tmp = -4.5 * (z / (a / t));
} else {
tmp = (x / a) * (y / 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if y <= -4.6e-66: tmp = (x * 0.5) * (1.0 / (a / y)) elif y <= 3e+64: tmp = -4.5 * (z / (a / t)) else: tmp = (x / a) * (y / 2.0) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.6e-66) tmp = Float64(Float64(x * 0.5) * Float64(1.0 / Float64(a / y))); elseif (y <= 3e+64) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); else tmp = Float64(Float64(x / a) * Float64(y / 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (y <= -4.6e-66)
tmp = (x * 0.5) * (1.0 / (a / y));
elseif (y <= 3e+64)
tmp = -4.5 * (z / (a / t));
else
tmp = (x / a) * (y / 2.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.6e-66], N[(N[(x * 0.5), $MachinePrecision] * N[(1.0 / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+64], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-66}:\\
\;\;\;\;\left(x \cdot 0.5\right) \cdot \frac{1}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+64}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\
\end{array}
\end{array}
if y < -4.59999999999999984e-66Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*94.1%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
associate-*r/94.1%
clear-num94.1%
*-commutative94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 52.5%
*-commutative52.5%
*-commutative52.5%
associate-/l*55.8%
associate-*l/55.8%
Simplified55.8%
div-inv55.8%
Applied egg-rr55.8%
if -4.59999999999999984e-66 < y < 3.0000000000000002e64Initial program 91.6%
sub-neg91.6%
+-commutative91.6%
neg-sub091.6%
associate-+l-91.6%
sub0-neg91.6%
neg-mul-191.6%
associate-/l*91.5%
associate-/r/91.5%
*-commutative91.5%
sub-neg91.5%
+-commutative91.5%
neg-sub091.5%
associate-+l-91.5%
sub0-neg91.5%
distribute-lft-neg-out91.5%
distribute-rgt-neg-in91.5%
Simplified91.4%
fma-udef91.4%
*-commutative91.4%
metadata-eval91.4%
distribute-lft-neg-in91.4%
distribute-rgt-neg-in91.4%
+-commutative91.4%
distribute-rgt-neg-in91.4%
distribute-lft-neg-in91.4%
metadata-eval91.4%
*-commutative91.4%
Applied egg-rr91.4%
Taylor expanded in z around 0 92.5%
+-commutative92.5%
*-commutative92.5%
fma-def92.5%
associate-/l*87.0%
associate-/r/89.0%
*-commutative89.0%
associate-/l*91.4%
associate-/r/91.2%
Simplified91.2%
Taylor expanded in y around 0 65.6%
associate-*l/69.3%
*-commutative69.3%
*-commutative69.3%
associate-*r/65.6%
associate-/l*68.8%
Simplified68.8%
if 3.0000000000000002e64 < y Initial program 84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
neg-mul-184.7%
associate-/l*84.5%
associate-/r/84.7%
*-commutative84.7%
sub-neg84.7%
+-commutative84.7%
neg-sub084.7%
associate-+l-84.7%
sub0-neg84.7%
distribute-lft-neg-out84.7%
distribute-rgt-neg-in84.7%
Simplified84.7%
associate-*r/84.8%
associate-/l*84.8%
div-inv84.8%
metadata-eval84.8%
*-commutative84.8%
metadata-eval84.8%
distribute-lft-neg-in84.8%
distribute-rgt-neg-in84.8%
fma-neg84.8%
add-sqr-sqrt36.0%
associate-/r*36.0%
fma-neg36.0%
distribute-rgt-neg-in36.0%
distribute-lft-neg-in36.0%
metadata-eval36.0%
*-commutative36.0%
Applied egg-rr36.0%
Taylor expanded in x around inf 65.2%
*-commutative65.2%
unpow265.2%
rem-square-sqrt65.6%
*-commutative65.6%
times-frac73.6%
Simplified73.6%
Final simplification65.7%
NOTE: x and y should be sorted in increasing order before calling this function. 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(x < y);
assert(z < t);
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.
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 x < y;
assert z < t;
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]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return -4.5 * (z * (t / a))
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(z * Float64(t / a))) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
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. 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}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 90.9%
sub-neg90.9%
+-commutative90.9%
neg-sub090.9%
associate-+l-90.9%
sub0-neg90.9%
neg-mul-190.9%
associate-/l*90.8%
associate-/r/90.8%
*-commutative90.8%
sub-neg90.8%
+-commutative90.8%
neg-sub090.8%
associate-+l-90.8%
sub0-neg90.8%
distribute-lft-neg-out90.8%
distribute-rgt-neg-in90.8%
Simplified90.8%
Taylor expanded in x around 0 49.9%
associate-/l*51.0%
Simplified51.0%
associate-/r/53.4%
Applied egg-rr53.4%
Final simplification53.4%
(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 2023185
(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)))