
(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}
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* a_m 2.0) 1e+73)
(/ (fma x y (* z (* t -9.0))) (* a_m 2.0))
(- (* (/ x a_m) (* y 0.5)) (* (/ z a_m) (* t 4.5))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((a_m * 2.0) <= 1e+73) {
tmp = fma(x, y, (z * (t * -9.0))) / (a_m * 2.0);
} else {
tmp = ((x / a_m) * (y * 0.5)) - ((z / a_m) * (t * 4.5));
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (Float64(a_m * 2.0) <= 1e+73) tmp = Float64(fma(x, y, Float64(z * Float64(t * -9.0))) / Float64(a_m * 2.0)); else tmp = Float64(Float64(Float64(x / a_m) * Float64(y * 0.5)) - Float64(Float64(z / a_m) * Float64(t * 4.5))); end return Float64(a_s * tmp) end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(a$95$m * 2.0), $MachinePrecision], 1e+73], N[(N[(x * y + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / a$95$m), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(z / a$95$m), $MachinePrecision] * N[(t * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \cdot 2 \leq 10^{+73}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a\_m} \cdot \left(y \cdot 0.5\right) - \frac{z}{a\_m} \cdot \left(t \cdot 4.5\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 2 binary64)) < 9.99999999999999983e72Initial program 93.1%
div-sub90.8%
*-commutative90.8%
div-sub93.1%
cancel-sign-sub-inv93.1%
*-commutative93.1%
fma-define93.6%
distribute-rgt-neg-in93.6%
associate-*r*94.0%
distribute-lft-neg-in94.0%
*-commutative94.0%
distribute-rgt-neg-in94.0%
metadata-eval94.0%
Simplified94.0%
if 9.99999999999999983e72 < (*.f64 a #s(literal 2 binary64)) Initial program 75.1%
Taylor expanded in z around 0 75.0%
associate-*r*75.1%
*-commutative75.1%
*-commutative75.1%
Simplified75.1%
div-sub75.0%
times-frac86.3%
div-inv86.3%
metadata-eval86.3%
associate-*r*86.3%
*-commutative86.3%
times-frac86.2%
associate-/l*92.7%
metadata-eval92.7%
Applied egg-rr92.7%
Taylor expanded in t around 0 86.2%
associate-*r/92.7%
associate-*r*92.9%
*-commutative92.9%
*-commutative92.9%
Simplified92.9%
Final simplification93.8%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* a_m 2.0) 1e+73)
(* (fma x y (* t (* z -9.0))) (/ 0.5 a_m))
(- (* (/ x a_m) (* y 0.5)) (* (/ z a_m) (* t 4.5))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((a_m * 2.0) <= 1e+73) {
tmp = fma(x, y, (t * (z * -9.0))) * (0.5 / a_m);
} else {
tmp = ((x / a_m) * (y * 0.5)) - ((z / a_m) * (t * 4.5));
}
return a_s * tmp;
}
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (Float64(a_m * 2.0) <= 1e+73) tmp = Float64(fma(x, y, Float64(t * Float64(z * -9.0))) * Float64(0.5 / a_m)); else tmp = Float64(Float64(Float64(x / a_m) * Float64(y * 0.5)) - Float64(Float64(z / a_m) * Float64(t * 4.5))); end return Float64(a_s * tmp) end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(a$95$m * 2.0), $MachinePrecision], 1e+73], N[(N[(x * y + N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / a$95$m), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(z / a$95$m), $MachinePrecision] * N[(t * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \cdot 2 \leq 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(x, y, t \cdot \left(z \cdot -9\right)\right) \cdot \frac{0.5}{a\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a\_m} \cdot \left(y \cdot 0.5\right) - \frac{z}{a\_m} \cdot \left(t \cdot 4.5\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 2 binary64)) < 9.99999999999999983e72Initial program 93.1%
div-inv93.1%
fma-neg93.6%
*-commutative93.6%
distribute-rgt-neg-in93.6%
distribute-rgt-neg-in93.6%
metadata-eval93.6%
*-commutative93.6%
associate-/r*93.6%
metadata-eval93.6%
Applied egg-rr93.6%
if 9.99999999999999983e72 < (*.f64 a #s(literal 2 binary64)) Initial program 75.1%
Taylor expanded in z around 0 75.0%
associate-*r*75.1%
*-commutative75.1%
*-commutative75.1%
Simplified75.1%
div-sub75.0%
times-frac86.3%
div-inv86.3%
metadata-eval86.3%
associate-*r*86.3%
*-commutative86.3%
times-frac86.2%
associate-/l*92.7%
metadata-eval92.7%
Applied egg-rr92.7%
Taylor expanded in t around 0 86.2%
associate-*r/92.7%
associate-*r*92.9%
*-commutative92.9%
*-commutative92.9%
Simplified92.9%
Final simplification93.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* (/ x a_m) (* y 0.5))))
(*
a_s
(if (<= (* x y) -4e+72)
t_1
(if (<= (* x y) 5e-57)
(* (* z t) (/ -4.5 a_m))
(if (<= (* x y) 1e+79)
(/ (* x y) (* a_m 2.0))
(if (<= (* x y) 2e+148) (* t (* (/ z a_m) -4.5)) t_1)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = (x / a_m) * (y * 0.5);
double tmp;
if ((x * y) <= -4e+72) {
tmp = t_1;
} else if ((x * y) <= 5e-57) {
tmp = (z * t) * (-4.5 / a_m);
} else if ((x * y) <= 1e+79) {
tmp = (x * y) / (a_m * 2.0);
} else if ((x * y) <= 2e+148) {
tmp = t * ((z / a_m) * -4.5);
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: t_1
real(8) :: tmp
t_1 = (x / a_m) * (y * 0.5d0)
if ((x * y) <= (-4d+72)) then
tmp = t_1
else if ((x * y) <= 5d-57) then
tmp = (z * t) * ((-4.5d0) / a_m)
else if ((x * y) <= 1d+79) then
tmp = (x * y) / (a_m * 2.0d0)
else if ((x * y) <= 2d+148) then
tmp = t * ((z / a_m) * (-4.5d0))
else
tmp = t_1
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = (x / a_m) * (y * 0.5);
double tmp;
if ((x * y) <= -4e+72) {
tmp = t_1;
} else if ((x * y) <= 5e-57) {
tmp = (z * t) * (-4.5 / a_m);
} else if ((x * y) <= 1e+79) {
tmp = (x * y) / (a_m * 2.0);
} else if ((x * y) <= 2e+148) {
tmp = t * ((z / a_m) * -4.5);
} else {
tmp = t_1;
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = (x / a_m) * (y * 0.5) tmp = 0 if (x * y) <= -4e+72: tmp = t_1 elif (x * y) <= 5e-57: tmp = (z * t) * (-4.5 / a_m) elif (x * y) <= 1e+79: tmp = (x * y) / (a_m * 2.0) elif (x * y) <= 2e+148: tmp = t * ((z / a_m) * -4.5) else: tmp = t_1 return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) t_1 = Float64(Float64(x / a_m) * Float64(y * 0.5)) tmp = 0.0 if (Float64(x * y) <= -4e+72) tmp = t_1; elseif (Float64(x * y) <= 5e-57) tmp = Float64(Float64(z * t) * Float64(-4.5 / a_m)); elseif (Float64(x * y) <= 1e+79) tmp = Float64(Float64(x * y) / Float64(a_m * 2.0)); elseif (Float64(x * y) <= 2e+148) tmp = Float64(t * Float64(Float64(z / a_m) * -4.5)); else tmp = t_1; end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = (x / a_m) * (y * 0.5);
tmp = 0.0;
if ((x * y) <= -4e+72)
tmp = t_1;
elseif ((x * y) <= 5e-57)
tmp = (z * t) * (-4.5 / a_m);
elseif ((x * y) <= 1e+79)
tmp = (x * y) / (a_m * 2.0);
elseif ((x * y) <= 2e+148)
tmp = t * ((z / a_m) * -4.5);
else
tmp = t_1;
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(N[(x / a$95$m), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], -4e+72], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-57], N[(N[(z * t), $MachinePrecision] * N[(-4.5 / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+79], N[(N[(x * y), $MachinePrecision] / N[(a$95$m * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+148], N[(t * N[(N[(z / a$95$m), $MachinePrecision] * -4.5), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := \frac{x}{a\_m} \cdot \left(y \cdot 0.5\right)\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a\_m}\\
\mathbf{elif}\;x \cdot y \leq 10^{+79}:\\
\;\;\;\;\frac{x \cdot y}{a\_m \cdot 2}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+148}:\\
\;\;\;\;t \cdot \left(\frac{z}{a\_m} \cdot -4.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if (*.f64 x y) < -3.99999999999999978e72 or 2.0000000000000001e148 < (*.f64 x y) Initial program 82.6%
Taylor expanded in x around inf 70.4%
times-frac83.6%
div-inv83.6%
metadata-eval83.6%
Applied egg-rr83.6%
if -3.99999999999999978e72 < (*.f64 x y) < 5.0000000000000002e-57Initial program 94.7%
Taylor expanded in x around 0 81.2%
associate-/l*80.7%
associate-*r*80.7%
*-commutative80.7%
associate-*l/81.3%
*-commutative81.3%
Applied egg-rr81.3%
associate-*r*81.2%
associate-/l*81.3%
*-commutative81.3%
Applied egg-rr81.3%
if 5.0000000000000002e-57 < (*.f64 x y) < 9.99999999999999967e78Initial program 95.9%
Taylor expanded in x around inf 62.8%
if 9.99999999999999967e78 < (*.f64 x y) < 2.0000000000000001e148Initial program 83.9%
Taylor expanded in z around 0 83.9%
associate-*r*83.7%
*-commutative83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in x around 0 67.9%
associate-*r/83.7%
associate-*r*83.7%
*-commutative83.7%
associate-*r*83.7%
Simplified83.7%
Final simplification80.5%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* x (/ (* y 0.5) a_m))))
(*
a_s
(if (<= x -7.2e+134)
t_1
(if (<= x -3.1e+82)
(* (* t (/ z a_m)) -4.5)
(if (or (<= x -5e-29) (not (<= x 9000000000000.0)))
t_1
(* -4.5 (/ (* z t) a_m))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * ((y * 0.5) / a_m);
double tmp;
if (x <= -7.2e+134) {
tmp = t_1;
} else if (x <= -3.1e+82) {
tmp = (t * (z / a_m)) * -4.5;
} else if ((x <= -5e-29) || !(x <= 9000000000000.0)) {
tmp = t_1;
} else {
tmp = -4.5 * ((z * t) / a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y * 0.5d0) / a_m)
if (x <= (-7.2d+134)) then
tmp = t_1
else if (x <= (-3.1d+82)) then
tmp = (t * (z / a_m)) * (-4.5d0)
else if ((x <= (-5d-29)) .or. (.not. (x <= 9000000000000.0d0))) then
tmp = t_1
else
tmp = (-4.5d0) * ((z * t) / a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * ((y * 0.5) / a_m);
double tmp;
if (x <= -7.2e+134) {
tmp = t_1;
} else if (x <= -3.1e+82) {
tmp = (t * (z / a_m)) * -4.5;
} else if ((x <= -5e-29) || !(x <= 9000000000000.0)) {
tmp = t_1;
} else {
tmp = -4.5 * ((z * t) / a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = x * ((y * 0.5) / a_m) tmp = 0 if x <= -7.2e+134: tmp = t_1 elif x <= -3.1e+82: tmp = (t * (z / a_m)) * -4.5 elif (x <= -5e-29) or not (x <= 9000000000000.0): tmp = t_1 else: tmp = -4.5 * ((z * t) / a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) t_1 = Float64(x * Float64(Float64(y * 0.5) / a_m)) tmp = 0.0 if (x <= -7.2e+134) tmp = t_1; elseif (x <= -3.1e+82) tmp = Float64(Float64(t * Float64(z / a_m)) * -4.5); elseif ((x <= -5e-29) || !(x <= 9000000000000.0)) tmp = t_1; else tmp = Float64(-4.5 * Float64(Float64(z * t) / a_m)); end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = x * ((y * 0.5) / a_m);
tmp = 0.0;
if (x <= -7.2e+134)
tmp = t_1;
elseif (x <= -3.1e+82)
tmp = (t * (z / a_m)) * -4.5;
elseif ((x <= -5e-29) || ~((x <= 9000000000000.0)))
tmp = t_1;
else
tmp = -4.5 * ((z * t) / a_m);
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(x * N[(N[(y * 0.5), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[x, -7.2e+134], t$95$1, If[LessEqual[x, -3.1e+82], N[(N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision] * -4.5), $MachinePrecision], If[Or[LessEqual[x, -5e-29], N[Not[LessEqual[x, 9000000000000.0]], $MachinePrecision]], t$95$1, N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{y \cdot 0.5}{a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{+82}:\\
\;\;\;\;\left(t \cdot \frac{z}{a\_m}\right) \cdot -4.5\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-29} \lor \neg \left(x \leq 9000000000000\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a\_m}\\
\end{array}
\end{array}
\end{array}
if x < -7.19999999999999976e134 or -3.10000000000000032e82 < x < -4.99999999999999986e-29 or 9e12 < x Initial program 84.6%
Taylor expanded in x around inf 57.7%
*-commutative57.7%
associate-/l*69.2%
associate-*r*69.2%
*-commutative69.2%
associate-*r/69.2%
Simplified69.2%
if -7.19999999999999976e134 < x < -3.10000000000000032e82Initial program 82.9%
Taylor expanded in x around 0 56.5%
associate-/l*56.4%
Applied egg-rr56.4%
if -4.99999999999999986e-29 < x < 9e12Initial program 95.0%
Taylor expanded in x around 0 70.2%
Final simplification69.2%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(let* ((t_1 (* x (/ (* y 0.5) a_m))))
(*
a_s
(if (<= x -7.2e+134)
t_1
(if (<= x -2.6e+82)
(* (* t (/ z a_m)) -4.5)
(if (or (<= x -1.85e-32) (not (<= x 9.6e+30)))
t_1
(* (* z t) (/ -4.5 a_m))))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * ((y * 0.5) / a_m);
double tmp;
if (x <= -7.2e+134) {
tmp = t_1;
} else if (x <= -2.6e+82) {
tmp = (t * (z / a_m)) * -4.5;
} else if ((x <= -1.85e-32) || !(x <= 9.6e+30)) {
tmp = t_1;
} else {
tmp = (z * t) * (-4.5 / a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y * 0.5d0) / a_m)
if (x <= (-7.2d+134)) then
tmp = t_1
else if (x <= (-2.6d+82)) then
tmp = (t * (z / a_m)) * (-4.5d0)
else if ((x <= (-1.85d-32)) .or. (.not. (x <= 9.6d+30))) then
tmp = t_1
else
tmp = (z * t) * ((-4.5d0) / a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double t_1 = x * ((y * 0.5) / a_m);
double tmp;
if (x <= -7.2e+134) {
tmp = t_1;
} else if (x <= -2.6e+82) {
tmp = (t * (z / a_m)) * -4.5;
} else if ((x <= -1.85e-32) || !(x <= 9.6e+30)) {
tmp = t_1;
} else {
tmp = (z * t) * (-4.5 / a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): t_1 = x * ((y * 0.5) / a_m) tmp = 0 if x <= -7.2e+134: tmp = t_1 elif x <= -2.6e+82: tmp = (t * (z / a_m)) * -4.5 elif (x <= -1.85e-32) or not (x <= 9.6e+30): tmp = t_1 else: tmp = (z * t) * (-4.5 / a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) t_1 = Float64(x * Float64(Float64(y * 0.5) / a_m)) tmp = 0.0 if (x <= -7.2e+134) tmp = t_1; elseif (x <= -2.6e+82) tmp = Float64(Float64(t * Float64(z / a_m)) * -4.5); elseif ((x <= -1.85e-32) || !(x <= 9.6e+30)) tmp = t_1; else tmp = Float64(Float64(z * t) * Float64(-4.5 / a_m)); end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
t_1 = x * ((y * 0.5) / a_m);
tmp = 0.0;
if (x <= -7.2e+134)
tmp = t_1;
elseif (x <= -2.6e+82)
tmp = (t * (z / a_m)) * -4.5;
elseif ((x <= -1.85e-32) || ~((x <= 9.6e+30)))
tmp = t_1;
else
tmp = (z * t) * (-4.5 / a_m);
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := Block[{t$95$1 = N[(x * N[(N[(y * 0.5), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(a$95$s * If[LessEqual[x, -7.2e+134], t$95$1, If[LessEqual[x, -2.6e+82], N[(N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision] * -4.5), $MachinePrecision], If[Or[LessEqual[x, -1.85e-32], N[Not[LessEqual[x, 9.6e+30]], $MachinePrecision]], t$95$1, N[(N[(z * t), $MachinePrecision] * N[(-4.5 / a$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{y \cdot 0.5}{a\_m}\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{+82}:\\
\;\;\;\;\left(t \cdot \frac{z}{a\_m}\right) \cdot -4.5\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-32} \lor \neg \left(x \leq 9.6 \cdot 10^{+30}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a\_m}\\
\end{array}
\end{array}
\end{array}
if x < -7.19999999999999976e134 or -2.5999999999999998e82 < x < -1.85e-32 or 9.5999999999999997e30 < x Initial program 84.9%
Taylor expanded in x around inf 57.9%
*-commutative57.9%
associate-/l*70.0%
associate-*r*70.0%
*-commutative70.0%
associate-*r/70.0%
Simplified70.0%
if -7.19999999999999976e134 < x < -2.5999999999999998e82Initial program 82.9%
Taylor expanded in x around 0 56.5%
associate-/l*56.4%
Applied egg-rr56.4%
if -1.85e-32 < x < 9.5999999999999997e30Initial program 94.5%
Taylor expanded in x around 0 69.7%
associate-/l*69.9%
associate-*r*69.9%
*-commutative69.9%
associate-*l/69.7%
*-commutative69.7%
Applied egg-rr69.7%
associate-*r*69.7%
associate-/l*69.8%
*-commutative69.8%
Applied egg-rr69.8%
Final simplification69.3%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= x -1.12e+135)
(* x (/ (* y 0.5) a_m))
(if (<= x -2.5e+83)
(* (* t (/ z a_m)) -4.5)
(if (or (<= x -1.8e-31) (not (<= x 1.6e+31)))
(* (/ x a_m) (* y 0.5))
(* (* z t) (/ -4.5 a_m)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (x <= -1.12e+135) {
tmp = x * ((y * 0.5) / a_m);
} else if (x <= -2.5e+83) {
tmp = (t * (z / a_m)) * -4.5;
} else if ((x <= -1.8e-31) || !(x <= 1.6e+31)) {
tmp = (x / a_m) * (y * 0.5);
} else {
tmp = (z * t) * (-4.5 / a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if (x <= (-1.12d+135)) then
tmp = x * ((y * 0.5d0) / a_m)
else if (x <= (-2.5d+83)) then
tmp = (t * (z / a_m)) * (-4.5d0)
else if ((x <= (-1.8d-31)) .or. (.not. (x <= 1.6d+31))) then
tmp = (x / a_m) * (y * 0.5d0)
else
tmp = (z * t) * ((-4.5d0) / a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (x <= -1.12e+135) {
tmp = x * ((y * 0.5) / a_m);
} else if (x <= -2.5e+83) {
tmp = (t * (z / a_m)) * -4.5;
} else if ((x <= -1.8e-31) || !(x <= 1.6e+31)) {
tmp = (x / a_m) * (y * 0.5);
} else {
tmp = (z * t) * (-4.5 / a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): tmp = 0 if x <= -1.12e+135: tmp = x * ((y * 0.5) / a_m) elif x <= -2.5e+83: tmp = (t * (z / a_m)) * -4.5 elif (x <= -1.8e-31) or not (x <= 1.6e+31): tmp = (x / a_m) * (y * 0.5) else: tmp = (z * t) * (-4.5 / a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (x <= -1.12e+135) tmp = Float64(x * Float64(Float64(y * 0.5) / a_m)); elseif (x <= -2.5e+83) tmp = Float64(Float64(t * Float64(z / a_m)) * -4.5); elseif ((x <= -1.8e-31) || !(x <= 1.6e+31)) tmp = Float64(Float64(x / a_m) * Float64(y * 0.5)); else tmp = Float64(Float64(z * t) * Float64(-4.5 / a_m)); end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
tmp = 0.0;
if (x <= -1.12e+135)
tmp = x * ((y * 0.5) / a_m);
elseif (x <= -2.5e+83)
tmp = (t * (z / a_m)) * -4.5;
elseif ((x <= -1.8e-31) || ~((x <= 1.6e+31)))
tmp = (x / a_m) * (y * 0.5);
else
tmp = (z * t) * (-4.5 / a_m);
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[x, -1.12e+135], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.5e+83], N[(N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision] * -4.5), $MachinePrecision], If[Or[LessEqual[x, -1.8e-31], N[Not[LessEqual[x, 1.6e+31]], $MachinePrecision]], N[(N[(x / a$95$m), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(z * t), $MachinePrecision] * N[(-4.5 / a$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+135}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a\_m}\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{+83}:\\
\;\;\;\;\left(t \cdot \frac{z}{a\_m}\right) \cdot -4.5\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-31} \lor \neg \left(x \leq 1.6 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{x}{a\_m} \cdot \left(y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a\_m}\\
\end{array}
\end{array}
if x < -1.1199999999999999e135Initial program 94.2%
Taylor expanded in x around inf 74.8%
*-commutative74.8%
associate-/l*80.4%
associate-*r*80.4%
*-commutative80.4%
associate-*r/80.4%
Simplified80.4%
if -1.1199999999999999e135 < x < -2.50000000000000014e83Initial program 81.2%
Taylor expanded in x around 0 52.2%
associate-/l*52.0%
Applied egg-rr52.0%
if -2.50000000000000014e83 < x < -1.80000000000000002e-31 or 1.6e31 < x Initial program 80.6%
Taylor expanded in x around inf 49.1%
times-frac62.1%
div-inv62.1%
metadata-eval62.1%
Applied egg-rr62.1%
if -1.80000000000000002e-31 < x < 1.6e31Initial program 94.5%
Taylor expanded in x around 0 69.7%
associate-/l*69.9%
associate-*r*69.9%
*-commutative69.9%
associate-*l/69.7%
*-commutative69.7%
Applied egg-rr69.7%
associate-*r*69.7%
associate-/l*69.8%
*-commutative69.8%
Applied egg-rr69.8%
Final simplification68.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= x -7.2e+134)
(* x (/ (* y 0.5) a_m))
(if (<= x -2.5e+83)
(/ (* t -4.5) (/ a_m z))
(if (or (<= x -1.05e-29) (not (<= x 2.5e+27)))
(* (/ x a_m) (* y 0.5))
(* (* z t) (/ -4.5 a_m)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (x <= -7.2e+134) {
tmp = x * ((y * 0.5) / a_m);
} else if (x <= -2.5e+83) {
tmp = (t * -4.5) / (a_m / z);
} else if ((x <= -1.05e-29) || !(x <= 2.5e+27)) {
tmp = (x / a_m) * (y * 0.5);
} else {
tmp = (z * t) * (-4.5 / a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if (x <= (-7.2d+134)) then
tmp = x * ((y * 0.5d0) / a_m)
else if (x <= (-2.5d+83)) then
tmp = (t * (-4.5d0)) / (a_m / z)
else if ((x <= (-1.05d-29)) .or. (.not. (x <= 2.5d+27))) then
tmp = (x / a_m) * (y * 0.5d0)
else
tmp = (z * t) * ((-4.5d0) / a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if (x <= -7.2e+134) {
tmp = x * ((y * 0.5) / a_m);
} else if (x <= -2.5e+83) {
tmp = (t * -4.5) / (a_m / z);
} else if ((x <= -1.05e-29) || !(x <= 2.5e+27)) {
tmp = (x / a_m) * (y * 0.5);
} else {
tmp = (z * t) * (-4.5 / a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): tmp = 0 if x <= -7.2e+134: tmp = x * ((y * 0.5) / a_m) elif x <= -2.5e+83: tmp = (t * -4.5) / (a_m / z) elif (x <= -1.05e-29) or not (x <= 2.5e+27): tmp = (x / a_m) * (y * 0.5) else: tmp = (z * t) * (-4.5 / a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (x <= -7.2e+134) tmp = Float64(x * Float64(Float64(y * 0.5) / a_m)); elseif (x <= -2.5e+83) tmp = Float64(Float64(t * -4.5) / Float64(a_m / z)); elseif ((x <= -1.05e-29) || !(x <= 2.5e+27)) tmp = Float64(Float64(x / a_m) * Float64(y * 0.5)); else tmp = Float64(Float64(z * t) * Float64(-4.5 / a_m)); end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
tmp = 0.0;
if (x <= -7.2e+134)
tmp = x * ((y * 0.5) / a_m);
elseif (x <= -2.5e+83)
tmp = (t * -4.5) / (a_m / z);
elseif ((x <= -1.05e-29) || ~((x <= 2.5e+27)))
tmp = (x / a_m) * (y * 0.5);
else
tmp = (z * t) * (-4.5 / a_m);
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[x, -7.2e+134], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.5e+83], N[(N[(t * -4.5), $MachinePrecision] / N[(a$95$m / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.05e-29], N[Not[LessEqual[x, 2.5e+27]], $MachinePrecision]], N[(N[(x / a$95$m), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(z * t), $MachinePrecision] * N[(-4.5 / a$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+134}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a\_m}\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{+83}:\\
\;\;\;\;\frac{t \cdot -4.5}{\frac{a\_m}{z}}\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-29} \lor \neg \left(x \leq 2.5 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{a\_m} \cdot \left(y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \frac{-4.5}{a\_m}\\
\end{array}
\end{array}
if x < -7.19999999999999976e134Initial program 94.2%
Taylor expanded in x around inf 74.8%
*-commutative74.8%
associate-/l*80.4%
associate-*r*80.4%
*-commutative80.4%
associate-*r/80.4%
Simplified80.4%
if -7.19999999999999976e134 < x < -2.50000000000000014e83Initial program 81.2%
Taylor expanded in x around 0 52.2%
associate-/l*52.0%
associate-*r*51.9%
clear-num51.9%
un-div-inv51.6%
*-commutative51.6%
Applied egg-rr51.6%
if -2.50000000000000014e83 < x < -1.04999999999999995e-29 or 2.4999999999999999e27 < x Initial program 80.6%
Taylor expanded in x around inf 49.1%
times-frac62.1%
div-inv62.1%
metadata-eval62.1%
Applied egg-rr62.1%
if -1.04999999999999995e-29 < x < 2.4999999999999999e27Initial program 94.5%
Taylor expanded in x around 0 69.7%
associate-/l*69.9%
associate-*r*69.9%
*-commutative69.9%
associate-*l/69.7%
*-commutative69.7%
Applied egg-rr69.7%
associate-*r*69.7%
associate-/l*69.8%
*-commutative69.8%
Applied egg-rr69.8%
Final simplification68.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* a_m 2.0) 1e+73)
(/ (- (* x y) (* z (* t 9.0))) (* a_m 2.0))
(- (* (/ x a_m) (* y 0.5)) (* 4.5 (* t (/ z a_m)))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((a_m * 2.0) <= 1e+73) {
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
} else {
tmp = ((x / a_m) * (y * 0.5)) - (4.5 * (t * (z / a_m)));
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if ((a_m * 2.0d0) <= 1d+73) then
tmp = ((x * y) - (z * (t * 9.0d0))) / (a_m * 2.0d0)
else
tmp = ((x / a_m) * (y * 0.5d0)) - (4.5d0 * (t * (z / a_m)))
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((a_m * 2.0) <= 1e+73) {
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
} else {
tmp = ((x / a_m) * (y * 0.5)) - (4.5 * (t * (z / a_m)));
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): tmp = 0 if (a_m * 2.0) <= 1e+73: tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0) else: tmp = ((x / a_m) * (y * 0.5)) - (4.5 * (t * (z / a_m))) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (Float64(a_m * 2.0) <= 1e+73) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a_m * 2.0)); else tmp = Float64(Float64(Float64(x / a_m) * Float64(y * 0.5)) - Float64(4.5 * Float64(t * Float64(z / a_m)))); end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
tmp = 0.0;
if ((a_m * 2.0) <= 1e+73)
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
else
tmp = ((x / a_m) * (y * 0.5)) - (4.5 * (t * (z / a_m)));
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(a$95$m * 2.0), $MachinePrecision], 1e+73], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / a$95$m), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \cdot 2 \leq 10^{+73}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a\_m} \cdot \left(y \cdot 0.5\right) - 4.5 \cdot \left(t \cdot \frac{z}{a\_m}\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 2 binary64)) < 9.99999999999999983e72Initial program 93.1%
Taylor expanded in z around 0 93.6%
associate-*r*93.6%
*-commutative93.6%
*-commutative93.6%
Simplified93.6%
if 9.99999999999999983e72 < (*.f64 a #s(literal 2 binary64)) Initial program 75.1%
Taylor expanded in z around 0 75.0%
associate-*r*75.1%
*-commutative75.1%
*-commutative75.1%
Simplified75.1%
div-sub75.0%
times-frac86.3%
div-inv86.3%
metadata-eval86.3%
associate-*r*86.3%
*-commutative86.3%
times-frac86.2%
associate-/l*92.7%
metadata-eval92.7%
Applied egg-rr92.7%
Final simplification93.4%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* a_m 2.0) 1e+73)
(/ (- (* x y) (* z (* t 9.0))) (* a_m 2.0))
(- (* (/ x a_m) (* y 0.5)) (* (/ z a_m) (* t 4.5))))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((a_m * 2.0) <= 1e+73) {
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
} else {
tmp = ((x / a_m) * (y * 0.5)) - ((z / a_m) * (t * 4.5));
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if ((a_m * 2.0d0) <= 1d+73) then
tmp = ((x * y) - (z * (t * 9.0d0))) / (a_m * 2.0d0)
else
tmp = ((x / a_m) * (y * 0.5d0)) - ((z / a_m) * (t * 4.5d0))
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((a_m * 2.0) <= 1e+73) {
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
} else {
tmp = ((x / a_m) * (y * 0.5)) - ((z / a_m) * (t * 4.5));
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): tmp = 0 if (a_m * 2.0) <= 1e+73: tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0) else: tmp = ((x / a_m) * (y * 0.5)) - ((z / a_m) * (t * 4.5)) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (Float64(a_m * 2.0) <= 1e+73) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a_m * 2.0)); else tmp = Float64(Float64(Float64(x / a_m) * Float64(y * 0.5)) - Float64(Float64(z / a_m) * Float64(t * 4.5))); end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
tmp = 0.0;
if ((a_m * 2.0) <= 1e+73)
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
else
tmp = ((x / a_m) * (y * 0.5)) - ((z / a_m) * (t * 4.5));
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(a$95$m * 2.0), $MachinePrecision], 1e+73], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / a$95$m), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(z / a$95$m), $MachinePrecision] * N[(t * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \cdot 2 \leq 10^{+73}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a\_m} \cdot \left(y \cdot 0.5\right) - \frac{z}{a\_m} \cdot \left(t \cdot 4.5\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 2 binary64)) < 9.99999999999999983e72Initial program 93.1%
Taylor expanded in z around 0 93.6%
associate-*r*93.6%
*-commutative93.6%
*-commutative93.6%
Simplified93.6%
if 9.99999999999999983e72 < (*.f64 a #s(literal 2 binary64)) Initial program 75.1%
Taylor expanded in z around 0 75.0%
associate-*r*75.1%
*-commutative75.1%
*-commutative75.1%
Simplified75.1%
div-sub75.0%
times-frac86.3%
div-inv86.3%
metadata-eval86.3%
associate-*r*86.3%
*-commutative86.3%
times-frac86.2%
associate-/l*92.7%
metadata-eval92.7%
Applied egg-rr92.7%
Taylor expanded in t around 0 86.2%
associate-*r/92.7%
associate-*r*92.9%
*-commutative92.9%
*-commutative92.9%
Simplified92.9%
Final simplification93.5%
a\_m = (fabs.f64 a)
a\_s = (copysign.f64 #s(literal 1 binary64) a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
(FPCore (a_s x y z t a_m)
:precision binary64
(*
a_s
(if (<= (* x y) 2e+277)
(/ (- (* x y) (* z (* t 9.0))) (* a_m 2.0))
(* x (/ (* y 0.5) a_m)))))a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((x * y) <= 2e+277) {
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
} else {
tmp = x * ((y * 0.5) / a_m);
}
return a_s * tmp;
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
real(8) :: tmp
if ((x * y) <= 2d+277) then
tmp = ((x * y) - (z * (t * 9.0d0))) / (a_m * 2.0d0)
else
tmp = x * ((y * 0.5d0) / a_m)
end if
code = a_s * tmp
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
double tmp;
if ((x * y) <= 2e+277) {
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
} else {
tmp = x * ((y * 0.5) / a_m);
}
return a_s * tmp;
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): tmp = 0 if (x * y) <= 2e+277: tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0) else: tmp = x * ((y * 0.5) / a_m) return a_s * tmp
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) tmp = 0.0 if (Float64(x * y) <= 2e+277) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a_m * 2.0)); else tmp = Float64(x * Float64(Float64(y * 0.5) / a_m)); end return Float64(a_s * tmp) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp_2 = code(a_s, x, y, z, t, a_m)
tmp = 0.0;
if ((x * y) <= 2e+277)
tmp = ((x * y) - (z * (t * 9.0))) / (a_m * 2.0);
else
tmp = x * ((y * 0.5) / a_m);
end
tmp_2 = a_s * tmp;
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * If[LessEqual[N[(x * y), $MachinePrecision], 2e+277], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a$95$m * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot y \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a\_m \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a\_m}\\
\end{array}
\end{array}
if (*.f64 x y) < 2.00000000000000001e277Initial program 93.7%
Taylor expanded in z around 0 94.1%
associate-*r*94.1%
*-commutative94.1%
*-commutative94.1%
Simplified94.1%
if 2.00000000000000001e277 < (*.f64 x y) Initial program 50.9%
Taylor expanded in x around inf 50.9%
*-commutative50.9%
associate-/l*99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*r/99.8%
Simplified99.8%
Final simplification94.5%
a\_m = (fabs.f64 a) a\_s = (copysign.f64 #s(literal 1 binary64) a) NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function. (FPCore (a_s x y z t a_m) :precision binary64 (* a_s (* (* t (/ z a_m)) -4.5)))
a\_m = fabs(a);
a\_s = copysign(1.0, a);
assert(x < y && y < z && z < t && t < a_m);
double code(double a_s, double x, double y, double z, double t, double a_m) {
return a_s * ((t * (z / a_m)) * -4.5);
}
a\_m = abs(a)
a\_s = copysign(1.0d0, a)
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
real(8) function code(a_s, x, y, z, t, a_m)
real(8), intent (in) :: a_s
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_m
code = a_s * ((t * (z / a_m)) * (-4.5d0))
end function
a\_m = Math.abs(a);
a\_s = Math.copySign(1.0, a);
assert x < y && y < z && z < t && t < a_m;
public static double code(double a_s, double x, double y, double z, double t, double a_m) {
return a_s * ((t * (z / a_m)) * -4.5);
}
a\_m = math.fabs(a) a\_s = math.copysign(1.0, a) [x, y, z, t, a_m] = sort([x, y, z, t, a_m]) def code(a_s, x, y, z, t, a_m): return a_s * ((t * (z / a_m)) * -4.5)
a\_m = abs(a) a\_s = copysign(1.0, a) x, y, z, t, a_m = sort([x, y, z, t, a_m]) function code(a_s, x, y, z, t, a_m) return Float64(a_s * Float64(Float64(t * Float64(z / a_m)) * -4.5)) end
a\_m = abs(a);
a\_s = sign(a) * abs(1.0);
x, y, z, t, a_m = num2cell(sort([x, y, z, t, a_m])){:}
function tmp = code(a_s, x, y, z, t, a_m)
tmp = a_s * ((t * (z / a_m)) * -4.5);
end
a\_m = N[Abs[a], $MachinePrecision]
a\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[a]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, and a_m should be sorted in increasing order before calling this function.
code[a$95$s_, x_, y_, z_, t_, a$95$m_] := N[(a$95$s * N[(N[(t * N[(z / a$95$m), $MachinePrecision]), $MachinePrecision] * -4.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a\_m = \left|a\right|
\\
a\_s = \mathsf{copysign}\left(1, a\right)
\\
[x, y, z, t, a_m] = \mathsf{sort}([x, y, z, t, a_m])\\
\\
a\_s \cdot \left(\left(t \cdot \frac{z}{a\_m}\right) \cdot -4.5\right)
\end{array}
Initial program 90.2%
Taylor expanded in x around 0 54.3%
associate-/l*54.9%
Applied egg-rr54.9%
Final simplification54.9%
(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 2024071
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:alt
(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)))