
(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 (or (<= (* a 2.0) -1e+53) (not (<= (* a 2.0) 2e-45))) (- (* t (* -4.5 (/ z a))) (* (/ y a) (/ x -2.0))) (/ (fma x y (* -9.0 (* t z))) (* a 2.0))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 2.0) <= -1e+53) || !((a * 2.0) <= 2e-45)) {
tmp = (t * (-4.5 * (z / a))) - ((y / a) * (x / -2.0));
} else {
tmp = fma(x, y, (-9.0 * (t * z))) / (a * 2.0);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 2.0) <= -1e+53) || !(Float64(a * 2.0) <= 2e-45)) tmp = Float64(Float64(t * Float64(-4.5 * Float64(z / a))) - Float64(Float64(y / a) * Float64(x / -2.0))); else tmp = Float64(fma(x, y, Float64(-9.0 * Float64(t * z))) / Float64(a * 2.0)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a * 2.0), $MachinePrecision], -1e+53], N[Not[LessEqual[N[(a * 2.0), $MachinePrecision], 2e-45]], $MachinePrecision]], N[(N[(t * N[(-4.5 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / a), $MachinePrecision] * N[(x / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(-9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq -1 \cdot 10^{+53} \lor \neg \left(a \cdot 2 \leq 2 \cdot 10^{-45}\right):\\
\;\;\;\;t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - \frac{y}{a} \cdot \frac{x}{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, -9 \cdot \left(t \cdot z\right)\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 a 2) < -9.9999999999999999e52 or 1.99999999999999997e-45 < (*.f64 a 2) Initial program 79.7%
div-sub79.7%
+-rgt-identity79.7%
div-sub79.7%
+-rgt-identity79.7%
associate-*l*79.7%
Simplified79.7%
div-sub79.7%
*-commutative79.7%
times-frac87.0%
fma-neg87.0%
div-inv87.0%
metadata-eval87.0%
times-frac96.7%
*-commutative96.7%
distribute-rgt-neg-in96.7%
*-commutative96.7%
associate-/l*96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Applied egg-rr84.3%
associate-*l/79.7%
associate-*l*79.7%
*-commutative79.7%
associate-*r*79.7%
*-commutative79.7%
associate-*r/88.7%
associate-*l*88.7%
times-frac96.8%
Simplified96.8%
if -9.9999999999999999e52 < (*.f64 a 2) < 1.99999999999999997e-45Initial program 95.1%
fma-neg96.6%
distribute-lft-neg-in96.6%
distribute-lft-neg-out96.6%
*-commutative96.6%
neg-mul-196.6%
associate-*r*96.6%
associate-*l*96.7%
metadata-eval96.7%
Simplified96.7%
Final simplification96.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (* z 9.0))))
(if (<= t_1 (- INFINITY))
(* z (* -4.5 (/ t a)))
(if (<= t_1 -5e-222)
(/ (- (* y x) t_1) (* a 2.0))
(if (<= t_1 2e-251)
(* (/ y a) (/ x 2.0))
(if (<= t_1 5e+219)
(* (/ -0.5 a) (- (* z (* t 9.0)) (* y x)))
(* t (* -4.5 (/ z a)))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (z * 9.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * (-4.5 * (t / a));
} else if (t_1 <= -5e-222) {
tmp = ((y * x) - t_1) / (a * 2.0);
} else if (t_1 <= 2e-251) {
tmp = (y / a) * (x / 2.0);
} else if (t_1 <= 5e+219) {
tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x));
} else {
tmp = t * (-4.5 * (z / a));
}
return tmp;
}
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (z * 9.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z * (-4.5 * (t / a));
} else if (t_1 <= -5e-222) {
tmp = ((y * x) - t_1) / (a * 2.0);
} else if (t_1 <= 2e-251) {
tmp = (y / a) * (x / 2.0);
} else if (t_1 <= 5e+219) {
tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x));
} else {
tmp = t * (-4.5 * (z / a));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = t * (z * 9.0) tmp = 0 if t_1 <= -math.inf: tmp = z * (-4.5 * (t / a)) elif t_1 <= -5e-222: tmp = ((y * x) - t_1) / (a * 2.0) elif t_1 <= 2e-251: tmp = (y / a) * (x / 2.0) elif t_1 <= 5e+219: tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x)) else: tmp = t * (-4.5 * (z / a)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(t * Float64(z * 9.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (t_1 <= -5e-222) tmp = Float64(Float64(Float64(y * x) - t_1) / Float64(a * 2.0)); elseif (t_1 <= 2e-251) tmp = Float64(Float64(y / a) * Float64(x / 2.0)); elseif (t_1 <= 5e+219) tmp = Float64(Float64(-0.5 / a) * Float64(Float64(z * Float64(t * 9.0)) - Float64(y * x))); else tmp = Float64(t * Float64(-4.5 * Float64(z / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = t * (z * 9.0);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = z * (-4.5 * (t / a));
elseif (t_1 <= -5e-222)
tmp = ((y * x) - t_1) / (a * 2.0);
elseif (t_1 <= 2e-251)
tmp = (y / a) * (x / 2.0);
elseif (t_1 <= 5e+219)
tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x));
else
tmp = t * (-4.5 * (z / 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_] := Block[{t$95$1 = N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-222], N[(N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-251], N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+219], N[(N[(-0.5 / a), $MachinePrecision] * N[(N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.5 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 9\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-222}:\\
\;\;\;\;\frac{y \cdot x - t_1}{a \cdot 2}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-251}:\\
\;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;\frac{-0.5}{a} \cdot \left(z \cdot \left(t \cdot 9\right) - y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4.5 \cdot \frac{z}{a}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 z 9) t) < -inf.0Initial program 54.5%
div-sub54.5%
+-rgt-identity54.5%
div-sub54.5%
+-rgt-identity54.5%
associate-*l*54.5%
Simplified54.5%
Taylor expanded in x around 0 65.1%
*-commutative65.1%
times-frac65.1%
metadata-eval65.1%
associate-*l/89.4%
associate-*r*89.4%
Applied egg-rr89.4%
if -inf.0 < (*.f64 (*.f64 z 9) t) < -5.00000000000000008e-222Initial program 97.5%
if -5.00000000000000008e-222 < (*.f64 (*.f64 z 9) t) < 2.00000000000000003e-251Initial program 83.7%
div-sub83.7%
+-rgt-identity83.7%
div-sub83.7%
+-rgt-identity83.7%
associate-*l*83.7%
Simplified83.7%
frac-2neg83.7%
div-inv83.6%
*-commutative83.6%
*-commutative83.6%
distribute-lft-neg-in83.6%
associate-/r*83.6%
metadata-eval83.6%
metadata-eval83.6%
neg-sub083.6%
sub-neg83.6%
+-commutative83.6%
associate--r+83.6%
neg-sub083.6%
remove-double-neg83.6%
Applied egg-rr83.6%
Taylor expanded in z around 0 81.8%
associate-*r*81.8%
neg-mul-181.8%
*-commutative81.8%
Simplified81.8%
associate-*l/81.9%
*-commutative81.9%
associate-/l*81.9%
div-inv81.9%
metadata-eval81.9%
distribute-rgt-neg-out81.9%
distribute-lft-neg-in81.9%
times-frac93.1%
distribute-neg-frac93.1%
clear-num92.9%
associate-*r/92.8%
frac-2neg92.8%
*-rgt-identity92.8%
frac-2neg92.8%
distribute-frac-neg92.8%
remove-double-neg92.8%
distribute-frac-neg92.8%
frac-2neg92.8%
Applied egg-rr92.8%
associate-/l/95.1%
distribute-neg-frac95.1%
metadata-eval95.1%
associate-/r/93.0%
associate-/l*93.1%
associate-*r/81.9%
associate-/r*81.9%
times-frac93.1%
Simplified93.1%
if 2.00000000000000003e-251 < (*.f64 (*.f64 z 9) t) < 5e219Initial program 96.0%
div-sub96.0%
+-rgt-identity96.0%
div-sub96.0%
+-rgt-identity96.0%
associate-*l*95.9%
Simplified95.9%
frac-2neg95.9%
div-inv95.9%
*-commutative95.9%
*-commutative95.9%
distribute-lft-neg-in95.9%
associate-/r*95.9%
metadata-eval95.9%
metadata-eval95.9%
neg-sub095.9%
sub-neg95.9%
+-commutative95.9%
associate--r+95.9%
neg-sub095.9%
remove-double-neg95.9%
Applied egg-rr95.9%
if 5e219 < (*.f64 (*.f64 z 9) t) Initial program 52.3%
div-sub48.1%
+-rgt-identity48.1%
div-sub52.3%
+-rgt-identity52.3%
associate-*l*52.2%
Simplified52.2%
Taylor expanded in x around 0 56.3%
*-commutative56.3%
times-frac56.3%
associate-*r/95.4%
metadata-eval95.4%
associate-*l*95.5%
*-commutative95.5%
Applied egg-rr95.5%
Final simplification95.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= (* a 2.0) -1e+53) (not (<= (* a 2.0) 2e-45))) (- (* t (* -4.5 (/ z a))) (* (/ y a) (/ x -2.0))) (/ (- (* y x) (* z (* t 9.0))) (* a 2.0))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a * 2.0) <= -1e+53) || !((a * 2.0) <= 2e-45)) {
tmp = (t * (-4.5 * (z / a))) - ((y / a) * (x / -2.0));
} else {
tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0);
}
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 (((a * 2.0d0) <= (-1d+53)) .or. (.not. ((a * 2.0d0) <= 2d-45))) then
tmp = (t * ((-4.5d0) * (z / a))) - ((y / a) * (x / (-2.0d0)))
else
tmp = ((y * x) - (z * (t * 9.0d0))) / (a * 2.0d0)
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 (((a * 2.0) <= -1e+53) || !((a * 2.0) <= 2e-45)) {
tmp = (t * (-4.5 * (z / a))) - ((y / a) * (x / -2.0));
} else {
tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if ((a * 2.0) <= -1e+53) or not ((a * 2.0) <= 2e-45): tmp = (t * (-4.5 * (z / a))) - ((y / a) * (x / -2.0)) else: tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a * 2.0) <= -1e+53) || !(Float64(a * 2.0) <= 2e-45)) tmp = Float64(Float64(t * Float64(-4.5 * Float64(z / a))) - Float64(Float64(y / a) * Float64(x / -2.0))); else tmp = Float64(Float64(Float64(y * x) - Float64(z * Float64(t * 9.0))) / Float64(a * 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (((a * 2.0) <= -1e+53) || ~(((a * 2.0) <= 2e-45)))
tmp = (t * (-4.5 * (z / a))) - ((y / a) * (x / -2.0));
else
tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0);
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[Or[LessEqual[N[(a * 2.0), $MachinePrecision], -1e+53], N[Not[LessEqual[N[(a * 2.0), $MachinePrecision], 2e-45]], $MachinePrecision]], N[(N[(t * N[(-4.5 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / a), $MachinePrecision] * N[(x / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq -1 \cdot 10^{+53} \lor \neg \left(a \cdot 2 \leq 2 \cdot 10^{-45}\right):\\
\;\;\;\;t \cdot \left(-4.5 \cdot \frac{z}{a}\right) - \frac{y}{a} \cdot \frac{x}{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x - z \cdot \left(t \cdot 9\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 a 2) < -9.9999999999999999e52 or 1.99999999999999997e-45 < (*.f64 a 2) Initial program 79.7%
div-sub79.7%
+-rgt-identity79.7%
div-sub79.7%
+-rgt-identity79.7%
associate-*l*79.7%
Simplified79.7%
div-sub79.7%
*-commutative79.7%
times-frac87.0%
fma-neg87.0%
div-inv87.0%
metadata-eval87.0%
times-frac96.7%
*-commutative96.7%
distribute-rgt-neg-in96.7%
*-commutative96.7%
associate-/l*96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Applied egg-rr84.3%
associate-*l/79.7%
associate-*l*79.7%
*-commutative79.7%
associate-*r*79.7%
*-commutative79.7%
associate-*r/88.7%
associate-*l*88.7%
times-frac96.8%
Simplified96.8%
if -9.9999999999999999e52 < (*.f64 a 2) < 1.99999999999999997e-45Initial program 95.1%
div-sub91.9%
+-rgt-identity91.9%
div-sub95.1%
+-rgt-identity95.1%
associate-*l*95.0%
Simplified95.0%
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 (<= (* y x) 5e+298) (* (/ -0.5 a) (- (* z (* t 9.0)) (* y x))) (/ (* y (/ x a)) 2.0)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * x) <= 5e+298) {
tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x));
} else {
tmp = (y * (x / a)) / 2.0;
}
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 ((y * x) <= 5d+298) then
tmp = ((-0.5d0) / a) * ((z * (t * 9.0d0)) - (y * x))
else
tmp = (y * (x / a)) / 2.0d0
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 ((y * x) <= 5e+298) {
tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x));
} else {
tmp = (y * (x / a)) / 2.0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (y * x) <= 5e+298: tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x)) else: tmp = (y * (x / a)) / 2.0 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(y * x) <= 5e+298) tmp = Float64(Float64(-0.5 / a) * Float64(Float64(z * Float64(t * 9.0)) - Float64(y * x))); else tmp = Float64(Float64(y * Float64(x / a)) / 2.0); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((y * x) <= 5e+298)
tmp = (-0.5 / a) * ((z * (t * 9.0)) - (y * x));
else
tmp = (y * (x / a)) / 2.0;
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[(y * x), $MachinePrecision], 5e+298], N[(N[(-0.5 / a), $MachinePrecision] * N[(N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq 5 \cdot 10^{+298}:\\
\;\;\;\;\frac{-0.5}{a} \cdot \left(z \cdot \left(t \cdot 9\right) - y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{a}}{2}\\
\end{array}
\end{array}
if (*.f64 x y) < 5.0000000000000003e298Initial program 90.2%
div-sub88.5%
+-rgt-identity88.5%
div-sub90.2%
+-rgt-identity90.2%
associate-*l*90.2%
Simplified90.2%
frac-2neg90.2%
div-inv90.1%
*-commutative90.1%
*-commutative90.1%
distribute-lft-neg-in90.1%
associate-/r*90.1%
metadata-eval90.1%
metadata-eval90.1%
neg-sub090.1%
sub-neg90.1%
+-commutative90.1%
associate--r+90.1%
neg-sub090.1%
remove-double-neg90.1%
Applied egg-rr90.1%
if 5.0000000000000003e298 < (*.f64 x y) Initial program 56.9%
div-sub56.9%
+-rgt-identity56.9%
div-sub56.9%
+-rgt-identity56.9%
associate-*l*56.9%
Simplified56.9%
frac-2neg56.9%
div-inv56.9%
*-commutative56.9%
*-commutative56.9%
distribute-lft-neg-in56.9%
associate-/r*56.9%
metadata-eval56.9%
metadata-eval56.9%
neg-sub056.9%
sub-neg56.9%
+-commutative56.9%
associate--r+56.9%
neg-sub056.9%
remove-double-neg56.9%
Applied egg-rr56.9%
Taylor expanded in z around 0 61.4%
associate-*r*61.4%
neg-mul-161.4%
*-commutative61.4%
Simplified61.4%
associate-*l/61.4%
*-commutative61.4%
associate-/l*61.4%
div-inv61.4%
metadata-eval61.4%
distribute-rgt-neg-out61.4%
distribute-lft-neg-in61.4%
times-frac95.2%
distribute-neg-frac95.2%
associate-*r/95.2%
frac-2neg95.2%
*-commutative95.2%
clear-num95.2%
distribute-neg-frac95.2%
remove-double-neg95.2%
frac-2neg95.2%
div-inv95.3%
distribute-frac-neg95.3%
frac-2neg95.3%
associate-/r/95.5%
*-commutative95.5%
metadata-eval95.5%
Applied egg-rr95.5%
Final simplification90.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* y x) 5e+298) (/ (- (* y x) (* z (* t 9.0))) (* a 2.0)) (/ (* y (/ x a)) 2.0)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * x) <= 5e+298) {
tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0);
} else {
tmp = (y * (x / a)) / 2.0;
}
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 ((y * x) <= 5d+298) then
tmp = ((y * x) - (z * (t * 9.0d0))) / (a * 2.0d0)
else
tmp = (y * (x / a)) / 2.0d0
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 ((y * x) <= 5e+298) {
tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0);
} else {
tmp = (y * (x / a)) / 2.0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (y * x) <= 5e+298: tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0) else: tmp = (y * (x / a)) / 2.0 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(y * x) <= 5e+298) tmp = Float64(Float64(Float64(y * x) - Float64(z * Float64(t * 9.0))) / Float64(a * 2.0)); else tmp = Float64(Float64(y * Float64(x / a)) / 2.0); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((y * x) <= 5e+298)
tmp = ((y * x) - (z * (t * 9.0))) / (a * 2.0);
else
tmp = (y * (x / a)) / 2.0;
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[(y * x), $MachinePrecision], 5e+298], N[(N[(N[(y * x), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq 5 \cdot 10^{+298}:\\
\;\;\;\;\frac{y \cdot x - z \cdot \left(t \cdot 9\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{a}}{2}\\
\end{array}
\end{array}
if (*.f64 x y) < 5.0000000000000003e298Initial program 90.2%
div-sub88.5%
+-rgt-identity88.5%
div-sub90.2%
+-rgt-identity90.2%
associate-*l*90.2%
Simplified90.2%
if 5.0000000000000003e298 < (*.f64 x y) Initial program 56.9%
div-sub56.9%
+-rgt-identity56.9%
div-sub56.9%
+-rgt-identity56.9%
associate-*l*56.9%
Simplified56.9%
frac-2neg56.9%
div-inv56.9%
*-commutative56.9%
*-commutative56.9%
distribute-lft-neg-in56.9%
associate-/r*56.9%
metadata-eval56.9%
metadata-eval56.9%
neg-sub056.9%
sub-neg56.9%
+-commutative56.9%
associate--r+56.9%
neg-sub056.9%
remove-double-neg56.9%
Applied egg-rr56.9%
Taylor expanded in z around 0 61.4%
associate-*r*61.4%
neg-mul-161.4%
*-commutative61.4%
Simplified61.4%
associate-*l/61.4%
*-commutative61.4%
associate-/l*61.4%
div-inv61.4%
metadata-eval61.4%
distribute-rgt-neg-out61.4%
distribute-lft-neg-in61.4%
times-frac95.2%
distribute-neg-frac95.2%
associate-*r/95.2%
frac-2neg95.2%
*-commutative95.2%
clear-num95.2%
distribute-neg-frac95.2%
remove-double-neg95.2%
frac-2neg95.2%
div-inv95.3%
distribute-frac-neg95.3%
frac-2neg95.3%
associate-/r/95.5%
*-commutative95.5%
metadata-eval95.5%
Applied egg-rr95.5%
Final simplification90.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 0.5 (/ x (/ a y)))) (t_2 (* -4.5 (/ t (/ a z)))))
(if (<= z -2.05e+101)
t_2
(if (<= z -4.5e+60)
t_1
(if (<= z -2.1e+49)
(* -4.5 (/ (* t z) a))
(if (<= z 1.9e-42) t_1 t_2))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (x / (a / y));
double t_2 = -4.5 * (t / (a / z));
double tmp;
if (z <= -2.05e+101) {
tmp = t_2;
} else if (z <= -4.5e+60) {
tmp = t_1;
} else if (z <= -2.1e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 1.9e-42) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.5d0 * (x / (a / y))
t_2 = (-4.5d0) * (t / (a / z))
if (z <= (-2.05d+101)) then
tmp = t_2
else if (z <= (-4.5d+60)) then
tmp = t_1
else if (z <= (-2.1d+49)) then
tmp = (-4.5d0) * ((t * z) / a)
else if (z <= 1.9d-42) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (x / (a / y));
double t_2 = -4.5 * (t / (a / z));
double tmp;
if (z <= -2.05e+101) {
tmp = t_2;
} else if (z <= -4.5e+60) {
tmp = t_1;
} else if (z <= -2.1e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 1.9e-42) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = 0.5 * (x / (a / y)) t_2 = -4.5 * (t / (a / z)) tmp = 0 if z <= -2.05e+101: tmp = t_2 elif z <= -4.5e+60: tmp = t_1 elif z <= -2.1e+49: tmp = -4.5 * ((t * z) / a) elif z <= 1.9e-42: tmp = t_1 else: tmp = t_2 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(0.5 * Float64(x / Float64(a / y))) t_2 = Float64(-4.5 * Float64(t / Float64(a / z))) tmp = 0.0 if (z <= -2.05e+101) tmp = t_2; elseif (z <= -4.5e+60) tmp = t_1; elseif (z <= -2.1e+49) tmp = Float64(-4.5 * Float64(Float64(t * z) / a)); elseif (z <= 1.9e-42) tmp = t_1; else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 0.5 * (x / (a / y));
t_2 = -4.5 * (t / (a / z));
tmp = 0.0;
if (z <= -2.05e+101)
tmp = t_2;
elseif (z <= -4.5e+60)
tmp = t_1;
elseif (z <= -2.1e+49)
tmp = -4.5 * ((t * z) / a);
elseif (z <= 1.9e-42)
tmp = t_1;
else
tmp = t_2;
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_] := Block[{t$95$1 = N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+101], t$95$2, If[LessEqual[z, -4.5e+60], t$95$1, If[LessEqual[z, -2.1e+49], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-42], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{x}{\frac{a}{y}}\\
t_2 := -4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+101}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{+49}:\\
\;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.05e101 or 1.90000000000000009e-42 < z Initial program 82.6%
div-sub80.2%
+-rgt-identity80.2%
div-sub82.6%
+-rgt-identity82.6%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in x around 0 62.8%
associate-/l*73.5%
Simplified73.5%
if -2.05e101 < z < -4.50000000000000013e60 or -2.10000000000000011e49 < z < 1.90000000000000009e-42Initial program 92.1%
div-sub91.4%
+-rgt-identity91.4%
div-sub92.1%
+-rgt-identity92.1%
associate-*l*92.1%
Simplified92.1%
div-sub91.4%
*-commutative91.4%
times-frac91.4%
fma-neg91.4%
div-inv91.4%
metadata-eval91.4%
times-frac89.4%
*-commutative89.4%
distribute-rgt-neg-in89.4%
*-commutative89.4%
associate-/l*89.4%
metadata-eval89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 64.4%
associate-/l*66.2%
Simplified66.2%
if -4.50000000000000013e60 < z < -2.10000000000000011e49Initial program 80.7%
div-sub80.7%
+-rgt-identity80.7%
div-sub80.7%
+-rgt-identity80.7%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in x around 0 61.5%
Final simplification69.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -4.5 (/ t (/ a z)))))
(if (<= z -2.05e+101)
t_1
(if (<= z -1.7e+60)
(* x (* y (/ 0.5 a)))
(if (<= z -2.2e+49)
(* -4.5 (/ (* t z) a))
(if (<= z 3.7e-41) (* 0.5 (/ x (/ a y))) t_1))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = -4.5 * (t / (a / z));
double tmp;
if (z <= -2.05e+101) {
tmp = t_1;
} else if (z <= -1.7e+60) {
tmp = x * (y * (0.5 / a));
} else if (z <= -2.2e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 3.7e-41) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = (-4.5d0) * (t / (a / z))
if (z <= (-2.05d+101)) then
tmp = t_1
else if (z <= (-1.7d+60)) then
tmp = x * (y * (0.5d0 / a))
else if (z <= (-2.2d+49)) then
tmp = (-4.5d0) * ((t * z) / a)
else if (z <= 3.7d-41) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -4.5 * (t / (a / z));
double tmp;
if (z <= -2.05e+101) {
tmp = t_1;
} else if (z <= -1.7e+60) {
tmp = x * (y * (0.5 / a));
} else if (z <= -2.2e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 3.7e-41) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = -4.5 * (t / (a / z)) tmp = 0 if z <= -2.05e+101: tmp = t_1 elif z <= -1.7e+60: tmp = x * (y * (0.5 / a)) elif z <= -2.2e+49: tmp = -4.5 * ((t * z) / a) elif z <= 3.7e-41: tmp = 0.5 * (x / (a / y)) else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(-4.5 * Float64(t / Float64(a / z))) tmp = 0.0 if (z <= -2.05e+101) tmp = t_1; elseif (z <= -1.7e+60) tmp = Float64(x * Float64(y * Float64(0.5 / a))); elseif (z <= -2.2e+49) tmp = Float64(-4.5 * Float64(Float64(t * z) / a)); elseif (z <= 3.7e-41) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = -4.5 * (t / (a / z));
tmp = 0.0;
if (z <= -2.05e+101)
tmp = t_1;
elseif (z <= -1.7e+60)
tmp = x * (y * (0.5 / a));
elseif (z <= -2.2e+49)
tmp = -4.5 * ((t * z) / a);
elseif (z <= 3.7e-41)
tmp = 0.5 * (x / (a / y));
else
tmp = t_1;
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_] := Block[{t$95$1 = N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+101], t$95$1, If[LessEqual[z, -1.7e+60], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e+49], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-41], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := -4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{+49}:\\
\;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-41}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.05e101 or 3.7000000000000002e-41 < z Initial program 82.6%
div-sub80.2%
+-rgt-identity80.2%
div-sub82.6%
+-rgt-identity82.6%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in x around 0 62.8%
associate-/l*73.5%
Simplified73.5%
if -2.05e101 < z < -1.7e60Initial program 89.1%
div-sub89.1%
+-rgt-identity89.1%
div-sub89.1%
+-rgt-identity89.1%
associate-*l*88.9%
Simplified88.9%
frac-2neg88.9%
div-inv89.1%
*-commutative89.1%
*-commutative89.1%
distribute-lft-neg-in89.1%
associate-/r*89.1%
metadata-eval89.1%
metadata-eval89.1%
neg-sub089.1%
sub-neg89.1%
+-commutative89.1%
associate--r+89.1%
neg-sub089.1%
remove-double-neg89.1%
Applied egg-rr89.1%
Taylor expanded in z around 0 57.2%
associate-*r*57.2%
neg-mul-157.2%
*-commutative57.2%
Simplified57.2%
associate-*l/57.2%
*-commutative57.2%
associate-/l*57.2%
div-inv57.2%
metadata-eval57.2%
distribute-rgt-neg-out57.2%
distribute-lft-neg-in57.2%
times-frac67.6%
distribute-neg-frac67.6%
clear-num67.3%
associate-*r/67.8%
frac-2neg67.8%
*-rgt-identity67.8%
frac-2neg67.8%
distribute-frac-neg67.8%
remove-double-neg67.8%
distribute-frac-neg67.8%
frac-2neg67.8%
Applied egg-rr67.8%
associate-/l/78.0%
distribute-neg-frac78.0%
metadata-eval78.0%
Simplified78.0%
associate-*l/78.2%
associate-/r/67.6%
div-inv67.8%
associate-/r*67.8%
metadata-eval67.8%
Applied egg-rr67.8%
if -1.7e60 < z < -2.2000000000000001e49Initial program 80.7%
div-sub80.7%
+-rgt-identity80.7%
div-sub80.7%
+-rgt-identity80.7%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in x around 0 61.5%
if -2.2000000000000001e49 < z < 3.7000000000000002e-41Initial program 92.4%
div-sub91.5%
+-rgt-identity91.5%
div-sub92.4%
+-rgt-identity92.4%
associate-*l*92.4%
Simplified92.4%
div-sub91.6%
*-commutative91.6%
times-frac90.8%
fma-neg90.8%
div-inv90.8%
metadata-eval90.8%
times-frac89.4%
*-commutative89.4%
distribute-rgt-neg-in89.4%
*-commutative89.4%
associate-/l*89.4%
metadata-eval89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 64.9%
associate-/l*66.1%
Simplified66.1%
Final simplification69.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -4e+101)
(* -4.5 (/ t (/ a z)))
(if (<= z -1.85e+59)
(* x (* y (/ 0.5 a)))
(if (<= z -2.1e+49)
(* -4.5 (/ (* t z) a))
(if (<= z 1.7e-42) (* 0.5 (/ x (/ a y))) (* z (* t (/ -4.5 a))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+101) {
tmp = -4.5 * (t / (a / z));
} else if (z <= -1.85e+59) {
tmp = x * (y * (0.5 / a));
} else if (z <= -2.1e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 1.7e-42) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = z * (t * (-4.5 / 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 <= (-4d+101)) then
tmp = (-4.5d0) * (t / (a / z))
else if (z <= (-1.85d+59)) then
tmp = x * (y * (0.5d0 / a))
else if (z <= (-2.1d+49)) then
tmp = (-4.5d0) * ((t * z) / a)
else if (z <= 1.7d-42) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = z * (t * ((-4.5d0) / 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 <= -4e+101) {
tmp = -4.5 * (t / (a / z));
} else if (z <= -1.85e+59) {
tmp = x * (y * (0.5 / a));
} else if (z <= -2.1e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 1.7e-42) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = z * (t * (-4.5 / a));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e+101: tmp = -4.5 * (t / (a / z)) elif z <= -1.85e+59: tmp = x * (y * (0.5 / a)) elif z <= -2.1e+49: tmp = -4.5 * ((t * z) / a) elif z <= 1.7e-42: tmp = 0.5 * (x / (a / y)) else: tmp = z * (t * (-4.5 / a)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+101) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (z <= -1.85e+59) tmp = Float64(x * Float64(y * Float64(0.5 / a))); elseif (z <= -2.1e+49) tmp = Float64(-4.5 * Float64(Float64(t * z) / a)); elseif (z <= 1.7e-42) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = Float64(z * Float64(t * Float64(-4.5 / 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 <= -4e+101)
tmp = -4.5 * (t / (a / z));
elseif (z <= -1.85e+59)
tmp = x * (y * (0.5 / a));
elseif (z <= -2.1e+49)
tmp = -4.5 * ((t * z) / a);
elseif (z <= 1.7e-42)
tmp = 0.5 * (x / (a / y));
else
tmp = z * (t * (-4.5 / 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, -4e+101], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.85e+59], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e+49], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-42], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+101}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{+59}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{+49}:\\
\;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-42}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \frac{-4.5}{a}\right)\\
\end{array}
\end{array}
if z < -3.9999999999999999e101Initial program 86.5%
div-sub86.5%
+-rgt-identity86.5%
div-sub86.5%
+-rgt-identity86.5%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in x around 0 78.4%
associate-/l*91.6%
Simplified91.6%
if -3.9999999999999999e101 < z < -1.84999999999999999e59Initial program 89.1%
div-sub89.1%
+-rgt-identity89.1%
div-sub89.1%
+-rgt-identity89.1%
associate-*l*88.9%
Simplified88.9%
frac-2neg88.9%
div-inv89.1%
*-commutative89.1%
*-commutative89.1%
distribute-lft-neg-in89.1%
associate-/r*89.1%
metadata-eval89.1%
metadata-eval89.1%
neg-sub089.1%
sub-neg89.1%
+-commutative89.1%
associate--r+89.1%
neg-sub089.1%
remove-double-neg89.1%
Applied egg-rr89.1%
Taylor expanded in z around 0 57.2%
associate-*r*57.2%
neg-mul-157.2%
*-commutative57.2%
Simplified57.2%
associate-*l/57.2%
*-commutative57.2%
associate-/l*57.2%
div-inv57.2%
metadata-eval57.2%
distribute-rgt-neg-out57.2%
distribute-lft-neg-in57.2%
times-frac67.6%
distribute-neg-frac67.6%
clear-num67.3%
associate-*r/67.8%
frac-2neg67.8%
*-rgt-identity67.8%
frac-2neg67.8%
distribute-frac-neg67.8%
remove-double-neg67.8%
distribute-frac-neg67.8%
frac-2neg67.8%
Applied egg-rr67.8%
associate-/l/78.0%
distribute-neg-frac78.0%
metadata-eval78.0%
Simplified78.0%
associate-*l/78.2%
associate-/r/67.6%
div-inv67.8%
associate-/r*67.8%
metadata-eval67.8%
Applied egg-rr67.8%
if -1.84999999999999999e59 < z < -2.10000000000000011e49Initial program 80.7%
div-sub80.7%
+-rgt-identity80.7%
div-sub80.7%
+-rgt-identity80.7%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in x around 0 61.5%
if -2.10000000000000011e49 < z < 1.70000000000000011e-42Initial program 92.4%
div-sub91.5%
+-rgt-identity91.5%
div-sub92.4%
+-rgt-identity92.4%
associate-*l*92.4%
Simplified92.4%
div-sub91.6%
*-commutative91.6%
times-frac90.8%
fma-neg90.8%
div-inv90.8%
metadata-eval90.8%
times-frac89.4%
*-commutative89.4%
distribute-rgt-neg-in89.4%
*-commutative89.4%
associate-/l*89.4%
metadata-eval89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 64.9%
associate-/l*66.1%
Simplified66.1%
if 1.70000000000000011e-42 < z Initial program 81.0%
div-sub77.5%
+-rgt-identity77.5%
div-sub81.0%
+-rgt-identity81.0%
associate-*l*81.0%
Simplified81.0%
Taylor expanded in x around 0 56.3%
*-commutative56.3%
times-frac56.4%
metadata-eval56.4%
associate-*r/65.9%
associate-*r*66.0%
clear-num65.9%
div-inv66.0%
associate-/r/63.8%
*-commutative63.8%
Applied egg-rr63.8%
div-inv63.7%
associate-*l*63.8%
div-inv63.9%
*-commutative63.9%
Applied egg-rr63.9%
Final simplification68.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (* -4.5 (/ z a)))))
(if (<= z -2.05e+101)
t_1
(if (<= z -4.5e+59)
(* x (* y (/ 0.5 a)))
(if (<= z -2.5e+49)
(* -4.5 (/ (* t z) a))
(if (<= z 2.5e-43) (* 0.5 (/ x (/ a y))) t_1))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-4.5 * (z / a));
double tmp;
if (z <= -2.05e+101) {
tmp = t_1;
} else if (z <= -4.5e+59) {
tmp = x * (y * (0.5 / a));
} else if (z <= -2.5e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 2.5e-43) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = t * ((-4.5d0) * (z / a))
if (z <= (-2.05d+101)) then
tmp = t_1
else if (z <= (-4.5d+59)) then
tmp = x * (y * (0.5d0 / a))
else if (z <= (-2.5d+49)) then
tmp = (-4.5d0) * ((t * z) / a)
else if (z <= 2.5d-43) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-4.5 * (z / a));
double tmp;
if (z <= -2.05e+101) {
tmp = t_1;
} else if (z <= -4.5e+59) {
tmp = x * (y * (0.5 / a));
} else if (z <= -2.5e+49) {
tmp = -4.5 * ((t * z) / a);
} else if (z <= 2.5e-43) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = t * (-4.5 * (z / a)) tmp = 0 if z <= -2.05e+101: tmp = t_1 elif z <= -4.5e+59: tmp = x * (y * (0.5 / a)) elif z <= -2.5e+49: tmp = -4.5 * ((t * z) / a) elif z <= 2.5e-43: tmp = 0.5 * (x / (a / y)) else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(t * Float64(-4.5 * Float64(z / a))) tmp = 0.0 if (z <= -2.05e+101) tmp = t_1; elseif (z <= -4.5e+59) tmp = Float64(x * Float64(y * Float64(0.5 / a))); elseif (z <= -2.5e+49) tmp = Float64(-4.5 * Float64(Float64(t * z) / a)); elseif (z <= 2.5e-43) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = t * (-4.5 * (z / a));
tmp = 0.0;
if (z <= -2.05e+101)
tmp = t_1;
elseif (z <= -4.5e+59)
tmp = x * (y * (0.5 / a));
elseif (z <= -2.5e+49)
tmp = -4.5 * ((t * z) / a);
elseif (z <= 2.5e-43)
tmp = 0.5 * (x / (a / y));
else
tmp = t_1;
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_] := Block[{t$95$1 = N[(t * N[(-4.5 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+101], t$95$1, If[LessEqual[z, -4.5e+59], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e+49], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-43], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-4.5 \cdot \frac{z}{a}\right)\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{+59}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{+49}:\\
\;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-43}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.05e101 or 2.50000000000000009e-43 < z Initial program 82.6%
div-sub80.2%
+-rgt-identity80.2%
div-sub82.6%
+-rgt-identity82.6%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in x around 0 62.8%
*-commutative62.8%
times-frac62.8%
associate-*r/73.4%
metadata-eval73.4%
associate-*l*73.5%
*-commutative73.5%
Applied egg-rr73.5%
if -2.05e101 < z < -4.49999999999999959e59Initial program 89.1%
div-sub89.1%
+-rgt-identity89.1%
div-sub89.1%
+-rgt-identity89.1%
associate-*l*88.9%
Simplified88.9%
frac-2neg88.9%
div-inv89.1%
*-commutative89.1%
*-commutative89.1%
distribute-lft-neg-in89.1%
associate-/r*89.1%
metadata-eval89.1%
metadata-eval89.1%
neg-sub089.1%
sub-neg89.1%
+-commutative89.1%
associate--r+89.1%
neg-sub089.1%
remove-double-neg89.1%
Applied egg-rr89.1%
Taylor expanded in z around 0 57.2%
associate-*r*57.2%
neg-mul-157.2%
*-commutative57.2%
Simplified57.2%
associate-*l/57.2%
*-commutative57.2%
associate-/l*57.2%
div-inv57.2%
metadata-eval57.2%
distribute-rgt-neg-out57.2%
distribute-lft-neg-in57.2%
times-frac67.6%
distribute-neg-frac67.6%
clear-num67.3%
associate-*r/67.8%
frac-2neg67.8%
*-rgt-identity67.8%
frac-2neg67.8%
distribute-frac-neg67.8%
remove-double-neg67.8%
distribute-frac-neg67.8%
frac-2neg67.8%
Applied egg-rr67.8%
associate-/l/78.0%
distribute-neg-frac78.0%
metadata-eval78.0%
Simplified78.0%
associate-*l/78.2%
associate-/r/67.6%
div-inv67.8%
associate-/r*67.8%
metadata-eval67.8%
Applied egg-rr67.8%
if -4.49999999999999959e59 < z < -2.5000000000000002e49Initial program 80.7%
div-sub80.7%
+-rgt-identity80.7%
div-sub80.7%
+-rgt-identity80.7%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in x around 0 61.5%
if -2.5000000000000002e49 < z < 2.50000000000000009e-43Initial program 92.4%
div-sub91.5%
+-rgt-identity91.5%
div-sub92.4%
+-rgt-identity92.4%
associate-*l*92.4%
Simplified92.4%
div-sub91.6%
*-commutative91.6%
times-frac90.8%
fma-neg90.8%
div-inv90.8%
metadata-eval90.8%
times-frac89.4%
*-commutative89.4%
distribute-rgt-neg-in89.4%
*-commutative89.4%
associate-/l*89.4%
metadata-eval89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 64.9%
associate-/l*66.1%
Simplified66.1%
Final simplification69.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* y x) -5e+67) (* 0.5 (/ x (/ a y))) (if (<= (* y x) 5e-13) (* -4.5 (/ t (/ a z))) (* (/ y a) (/ x 2.0)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * x) <= -5e+67) {
tmp = 0.5 * (x / (a / y));
} else if ((y * x) <= 5e-13) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = (y / a) * (x / 2.0);
}
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 ((y * x) <= (-5d+67)) then
tmp = 0.5d0 * (x / (a / y))
else if ((y * x) <= 5d-13) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = (y / a) * (x / 2.0d0)
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 ((y * x) <= -5e+67) {
tmp = 0.5 * (x / (a / y));
} else if ((y * x) <= 5e-13) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = (y / a) * (x / 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (y * x) <= -5e+67: tmp = 0.5 * (x / (a / y)) elif (y * x) <= 5e-13: tmp = -4.5 * (t / (a / z)) else: tmp = (y / a) * (x / 2.0) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(y * x) <= -5e+67) tmp = Float64(0.5 * Float64(x / Float64(a / y))); elseif (Float64(y * x) <= 5e-13) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(Float64(y / a) * Float64(x / 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((y * x) <= -5e+67)
tmp = 0.5 * (x / (a / y));
elseif ((y * x) <= 5e-13)
tmp = -4.5 * (t / (a / z));
else
tmp = (y / a) * (x / 2.0);
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[(y * x), $MachinePrecision], -5e+67], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e-13], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -5 \cdot 10^{+67}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{-13}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999976e67Initial program 82.8%
div-sub76.1%
+-rgt-identity76.1%
div-sub82.8%
+-rgt-identity82.8%
associate-*l*82.8%
Simplified82.8%
div-sub76.1%
*-commutative76.1%
times-frac80.3%
fma-neg82.5%
div-inv82.5%
metadata-eval82.5%
times-frac84.3%
*-commutative84.3%
distribute-rgt-neg-in84.3%
*-commutative84.3%
associate-/l*84.3%
metadata-eval84.3%
Applied egg-rr84.3%
Taylor expanded in y around inf 78.5%
associate-/l*82.7%
Simplified82.7%
if -4.99999999999999976e67 < (*.f64 x y) < 4.9999999999999999e-13Initial program 89.7%
div-sub89.7%
+-rgt-identity89.7%
div-sub89.7%
+-rgt-identity89.7%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in x around 0 71.6%
associate-/l*78.1%
Simplified78.1%
if 4.9999999999999999e-13 < (*.f64 x y) Initial program 85.9%
div-sub84.6%
+-rgt-identity84.6%
div-sub85.9%
+-rgt-identity85.9%
associate-*l*85.9%
Simplified85.9%
frac-2neg85.9%
div-inv85.9%
*-commutative85.9%
*-commutative85.9%
distribute-lft-neg-in85.9%
associate-/r*85.9%
metadata-eval85.9%
metadata-eval85.9%
neg-sub085.9%
sub-neg85.9%
+-commutative85.9%
associate--r+85.9%
neg-sub085.9%
remove-double-neg85.9%
Applied egg-rr85.9%
Taylor expanded in z around 0 65.7%
associate-*r*65.7%
neg-mul-165.7%
*-commutative65.7%
Simplified65.7%
associate-*l/65.6%
*-commutative65.6%
associate-/l*65.6%
div-inv65.6%
metadata-eval65.6%
distribute-rgt-neg-out65.6%
distribute-lft-neg-in65.6%
times-frac74.3%
distribute-neg-frac74.3%
clear-num74.2%
associate-*r/74.2%
frac-2neg74.2%
*-rgt-identity74.2%
frac-2neg74.2%
distribute-frac-neg74.2%
remove-double-neg74.2%
distribute-frac-neg74.2%
frac-2neg74.2%
Applied egg-rr74.2%
associate-/l/74.1%
distribute-neg-frac74.1%
metadata-eval74.1%
associate-/r/74.2%
associate-/l*74.2%
associate-*r/65.6%
associate-/r*65.6%
times-frac74.3%
Simplified74.3%
Final simplification77.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (/ t (/ a z))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (t / (a / z));
}
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) * (t / (a / z))
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (t / (a / z));
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return -4.5 * (t / (a / z))
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(t / Float64(a / z))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (t / (a / z));
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[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
-4.5 \cdot \frac{t}{\frac{a}{z}}
\end{array}
Initial program 87.3%
div-sub85.8%
+-rgt-identity85.8%
div-sub87.3%
+-rgt-identity87.3%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in x around 0 49.9%
associate-/l*54.4%
Simplified54.4%
Final simplification54.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 2023297
(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)))