
(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 10 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: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (or (<= t_1 -1e+308) (not (<= t_1 1e+282)))
(fma (* t (/ z a)) -4.5 (* y (* 0.5 (/ x a))))
(/ t_1 (* a 2.0)))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -1e+308) || !(t_1 <= 1e+282)) {
tmp = fma((t * (z / a)), -4.5, (y * (0.5 * (x / a))));
} else {
tmp = t_1 / (a * 2.0);
}
return tmp;
}
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) tmp = 0.0 if ((t_1 <= -1e+308) || !(t_1 <= 1e+282)) tmp = fma(Float64(t * Float64(z / a)), -4.5, Float64(y * Float64(0.5 * Float64(x / a)))); else tmp = Float64(t_1 / Float64(a * 2.0)); end return tmp end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+308], N[Not[LessEqual[t$95$1, 1e+282]], $MachinePrecision]], N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] * -4.5 + N[(y * N[(0.5 * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+308} \lor \neg \left(t_1 \leq 10^{+282}\right):\\
\;\;\;\;\mathsf{fma}\left(t \cdot \frac{z}{a}, -4.5, y \cdot \left(0.5 \cdot \frac{x}{a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -1e308 or 1.00000000000000003e282 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 70.5%
sub-neg70.5%
+-commutative70.5%
neg-sub070.5%
associate-+l-70.5%
sub0-neg70.5%
neg-mul-170.5%
associate-/l*70.5%
associate-/r/70.4%
*-commutative70.4%
sub-neg70.4%
+-commutative70.4%
neg-sub070.4%
associate-+l-70.4%
sub0-neg70.4%
distribute-lft-neg-out70.4%
distribute-rgt-neg-in70.4%
Simplified70.5%
Taylor expanded in x around 0 66.8%
*-commutative66.8%
fma-def66.8%
associate-/l*87.5%
div-inv87.5%
clear-num87.5%
associate-*r/87.5%
*-commutative87.5%
associate-*r*87.5%
*-commutative87.5%
associate-*r/96.2%
*-un-lft-identity96.2%
times-frac96.2%
metadata-eval96.2%
Applied egg-rr96.2%
if -1e308 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 1.00000000000000003e282Initial program 98.7%
Final simplification98.1%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (or (<= t_1 -1e+308) (not (<= t_1 5e+299)))
(+ (* t (* (/ z a) -4.5)) (* y (/ 0.5 (/ a x))))
(/ t_1 (* a 2.0)))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -1e+308) || !(t_1 <= 5e+299)) {
tmp = (t * ((z / a) * -4.5)) + (y * (0.5 / (a / x)));
} else {
tmp = t_1 / (a * 2.0);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) - ((z * 9.0d0) * t)
if ((t_1 <= (-1d+308)) .or. (.not. (t_1 <= 5d+299))) then
tmp = (t * ((z / a) * (-4.5d0))) + (y * (0.5d0 / (a / x)))
else
tmp = t_1 / (a * 2.0d0)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -1e+308) || !(t_1 <= 5e+299)) {
tmp = (t * ((z / a) * -4.5)) + (y * (0.5 / (a / x)));
} else {
tmp = t_1 / (a * 2.0);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) - ((z * 9.0) * t) tmp = 0 if (t_1 <= -1e+308) or not (t_1 <= 5e+299): tmp = (t * ((z / a) * -4.5)) + (y * (0.5 / (a / x))) else: tmp = t_1 / (a * 2.0) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) tmp = 0.0 if ((t_1 <= -1e+308) || !(t_1 <= 5e+299)) tmp = Float64(Float64(t * Float64(Float64(z / a) * -4.5)) + Float64(y * Float64(0.5 / Float64(a / x)))); else tmp = Float64(t_1 / Float64(a * 2.0)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - ((z * 9.0) * t);
tmp = 0.0;
if ((t_1 <= -1e+308) || ~((t_1 <= 5e+299)))
tmp = (t * ((z / a) * -4.5)) + (y * (0.5 / (a / x)));
else
tmp = t_1 / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+308], N[Not[LessEqual[t$95$1, 5e+299]], $MachinePrecision]], N[(N[(t * N[(N[(z / a), $MachinePrecision] * -4.5), $MachinePrecision]), $MachinePrecision] + N[(y * N[(0.5 / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+308} \lor \neg \left(t_1 \leq 5 \cdot 10^{+299}\right):\\
\;\;\;\;t \cdot \left(\frac{z}{a} \cdot -4.5\right) + y \cdot \frac{0.5}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -1e308 or 5.0000000000000003e299 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 67.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
neg-mul-167.5%
associate-/l*67.5%
associate-/r/67.5%
*-commutative67.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
distribute-lft-neg-out67.5%
distribute-rgt-neg-in67.5%
Simplified67.5%
Taylor expanded in x around 0 63.4%
*-commutative63.4%
fma-def63.4%
associate-/l*86.2%
div-inv86.2%
clear-num86.2%
associate-*r/86.2%
*-commutative86.2%
associate-*r*86.2%
*-commutative86.2%
associate-*r/95.8%
*-un-lft-identity95.8%
times-frac95.8%
metadata-eval95.8%
Applied egg-rr95.8%
fma-udef95.8%
*-commutative95.8%
associate-*r*95.8%
*-commutative95.8%
associate-*l*95.8%
clear-num95.7%
un-div-inv95.7%
Applied egg-rr95.7%
if -1e308 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 5.0000000000000003e299Initial program 98.7%
Final simplification98.1%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (* z 9.0) t)))
(if (<= t_1 (- INFINITY))
(/ 1.0 (/ (/ a z) (* t -4.5)))
(/ (- (* x y) t_1) (* a 2.0)))))assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 1.0 / ((a / z) / (t * -4.5));
} else {
tmp = ((x * y) - t_1) / (a * 2.0);
}
return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z * 9.0) * t;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 1.0 / ((a / z) / (t * -4.5));
} else {
tmp = ((x * y) - t_1) / (a * 2.0);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (z * 9.0) * t tmp = 0 if t_1 <= -math.inf: tmp = 1.0 / ((a / z) / (t * -4.5)) else: tmp = ((x * y) - t_1) / (a * 2.0) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(z * 9.0) * t) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(1.0 / Float64(Float64(a / z) / Float64(t * -4.5))); else tmp = Float64(Float64(Float64(x * y) - t_1) / Float64(a * 2.0)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (z * 9.0) * t;
tmp = 0.0;
if (t_1 <= -Inf)
tmp = 1.0 / ((a / z) / (t * -4.5));
else
tmp = ((x * y) - t_1) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(1.0 / N[(N[(a / z), $MachinePrecision] / N[(t * -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{1}{\frac{\frac{a}{z}}{t \cdot -4.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - t_1}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z 9) t) < -inf.0Initial program 55.6%
sub-neg55.6%
+-commutative55.6%
neg-sub055.6%
associate-+l-55.6%
sub0-neg55.6%
neg-mul-155.6%
associate-/l*55.6%
associate-/r/55.6%
*-commutative55.6%
sub-neg55.6%
+-commutative55.6%
neg-sub055.6%
associate-+l-55.6%
sub0-neg55.6%
distribute-lft-neg-out55.6%
distribute-rgt-neg-in55.6%
Simplified55.6%
Taylor expanded in x around 0 55.6%
associate-/l*99.6%
Simplified99.6%
associate-*r/99.7%
clear-num99.8%
Applied egg-rr99.8%
if -inf.0 < (*.f64 (*.f64 z 9) t) Initial program 95.4%
Final simplification95.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* (+ (* x y) (* -9.0 (* z t))) (/ 0.5 a)))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return ((x * y) + (-9.0 * (z * t))) * (0.5 / a);
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) + ((-9.0d0) * (z * t))) * (0.5d0 / a)
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) + (-9.0 * (z * t))) * (0.5 / a);
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): return ((x * y) + (-9.0 * (z * t))) * (0.5 / a)
z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) + Float64(-9.0 * Float64(z * t))) * Float64(0.5 / a)) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = ((x * y) + (-9.0 * (z * t))) * (0.5 / a);
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] + N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\left(x \cdot y + -9 \cdot \left(z \cdot t\right)\right) \cdot \frac{0.5}{a}
\end{array}
Initial program 92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
associate-/l*92.5%
associate-/r/92.7%
*-commutative92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
distribute-lft-neg-out92.7%
distribute-rgt-neg-in92.7%
Simplified92.6%
Taylor expanded in x around 0 92.6%
Final simplification92.6%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): return ((x * y) - (z * (9.0 * t))) / (a * 2.0)
z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}
\end{array}
Initial program 92.7%
associate-*l*92.7%
Simplified92.7%
Final simplification92.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -1.5e-102) (* -4.5 (* z (/ t a))) (if (<= t 4.4e+96) (* y (/ (* x 0.5) a)) (* -4.5 (/ t (/ a z))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e-102) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.4e+96) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.5d-102)) then
tmp = (-4.5d0) * (z * (t / a))
else if (t <= 4.4d+96) then
tmp = y * ((x * 0.5d0) / a)
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e-102) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.4e+96) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -1.5e-102: tmp = -4.5 * (z * (t / a)) elif t <= 4.4e+96: tmp = y * ((x * 0.5) / a) else: tmp = -4.5 * (t / (a / z)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e-102) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); elseif (t <= 4.4e+96) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -1.5e-102)
tmp = -4.5 * (z * (t / a));
elseif (t <= 4.4e+96)
tmp = y * ((x * 0.5) / a);
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e-102], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+96], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-102}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+96}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.5e-102Initial program 92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
neg-mul-192.9%
associate-/l*92.4%
associate-/r/92.9%
*-commutative92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
distribute-lft-neg-out92.9%
distribute-rgt-neg-in92.9%
Simplified92.9%
Taylor expanded in x around 0 64.3%
associate-/l*68.3%
Simplified68.3%
associate-/r/70.8%
Applied egg-rr70.8%
if -1.5e-102 < t < 4.3999999999999998e96Initial program 93.9%
sub-neg93.9%
+-commutative93.9%
neg-sub093.9%
associate-+l-93.9%
sub0-neg93.9%
neg-mul-193.9%
associate-/l*93.9%
associate-/r/93.8%
*-commutative93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
distribute-lft-neg-out93.8%
distribute-rgt-neg-in93.8%
Simplified93.7%
Taylor expanded in x around inf 67.2%
associate-*r/67.2%
*-commutative67.2%
associate-*l/67.1%
associate-*r*65.5%
*-commutative65.5%
associate-*l/65.6%
Simplified65.6%
if 4.3999999999999998e96 < t Initial program 89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
neg-mul-189.3%
associate-/l*89.2%
associate-/r/89.3%
*-commutative89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
distribute-lft-neg-out89.3%
distribute-rgt-neg-in89.3%
Simplified89.2%
Taylor expanded in x around 0 67.9%
associate-/l*74.0%
Simplified74.0%
Final simplification69.0%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -5e-102) (* -4.5 (* z (/ t a))) (if (<= t 4.1e+94) (/ 0.5 (/ a (* x y))) (* -4.5 (/ t (/ a z))))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5e-102) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.1e+94) {
tmp = 0.5 / (a / (x * y));
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-5d-102)) then
tmp = (-4.5d0) * (z * (t / a))
else if (t <= 4.1d+94) then
tmp = 0.5d0 / (a / (x * y))
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5e-102) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.1e+94) {
tmp = 0.5 / (a / (x * y));
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -5e-102: tmp = -4.5 * (z * (t / a)) elif t <= 4.1e+94: tmp = 0.5 / (a / (x * y)) else: tmp = -4.5 * (t / (a / z)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -5e-102) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); elseif (t <= 4.1e+94) tmp = Float64(0.5 / Float64(a / Float64(x * y))); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -5e-102)
tmp = -4.5 * (z * (t / a));
elseif (t <= 4.1e+94)
tmp = 0.5 / (a / (x * y));
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5e-102], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+94], N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-102}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+94}:\\
\;\;\;\;\frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -5.00000000000000026e-102Initial program 92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
neg-mul-192.9%
associate-/l*92.4%
associate-/r/92.9%
*-commutative92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
distribute-lft-neg-out92.9%
distribute-rgt-neg-in92.9%
Simplified92.9%
Taylor expanded in x around 0 64.3%
associate-/l*68.3%
Simplified68.3%
associate-/r/70.8%
Applied egg-rr70.8%
if -5.00000000000000026e-102 < t < 4.10000000000000031e94Initial program 93.9%
sub-neg93.9%
+-commutative93.9%
neg-sub093.9%
associate-+l-93.9%
sub0-neg93.9%
neg-mul-193.9%
associate-/l*93.9%
associate-/r/93.8%
*-commutative93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
distribute-lft-neg-out93.8%
distribute-rgt-neg-in93.8%
Simplified93.7%
Taylor expanded in x around inf 67.2%
associate-*r/67.2%
*-commutative67.2%
associate-*l/67.1%
associate-*r*65.5%
*-commutative65.5%
associate-*l/65.6%
Simplified65.6%
associate-*r/67.2%
*-commutative67.2%
associate-*r*67.2%
*-commutative67.2%
associate-/l*67.2%
Applied egg-rr67.2%
if 4.10000000000000031e94 < t Initial program 89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
neg-mul-189.3%
associate-/l*89.2%
associate-/r/89.3%
*-commutative89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
distribute-lft-neg-out89.3%
distribute-rgt-neg-in89.3%
Simplified89.2%
Taylor expanded in x around 0 67.9%
associate-/l*74.0%
Simplified74.0%
Final simplification69.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -1.6e-101) (* -4.5 (* z (/ t a))) (if (<= t 4.1e+94) (/ 0.5 (/ a (* x y))) (/ (* t -4.5) (/ a z)))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e-101) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.1e+94) {
tmp = 0.5 / (a / (x * y));
} else {
tmp = (t * -4.5) / (a / z);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.6d-101)) then
tmp = (-4.5d0) * (z * (t / a))
else if (t <= 4.1d+94) then
tmp = 0.5d0 / (a / (x * y))
else
tmp = (t * (-4.5d0)) / (a / z)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e-101) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.1e+94) {
tmp = 0.5 / (a / (x * y));
} else {
tmp = (t * -4.5) / (a / z);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -1.6e-101: tmp = -4.5 * (z * (t / a)) elif t <= 4.1e+94: tmp = 0.5 / (a / (x * y)) else: tmp = (t * -4.5) / (a / z) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e-101) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); elseif (t <= 4.1e+94) tmp = Float64(0.5 / Float64(a / Float64(x * y))); else tmp = Float64(Float64(t * -4.5) / Float64(a / z)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -1.6e-101)
tmp = -4.5 * (z * (t / a));
elseif (t <= 4.1e+94)
tmp = 0.5 / (a / (x * y));
else
tmp = (t * -4.5) / (a / z);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e-101], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+94], N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * -4.5), $MachinePrecision] / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-101}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+94}:\\
\;\;\;\;\frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot -4.5}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.59999999999999989e-101Initial program 92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
neg-mul-192.9%
associate-/l*92.4%
associate-/r/92.9%
*-commutative92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
distribute-lft-neg-out92.9%
distribute-rgt-neg-in92.9%
Simplified92.9%
Taylor expanded in x around 0 64.3%
associate-/l*68.3%
Simplified68.3%
associate-/r/70.8%
Applied egg-rr70.8%
if -1.59999999999999989e-101 < t < 4.10000000000000031e94Initial program 93.9%
sub-neg93.9%
+-commutative93.9%
neg-sub093.9%
associate-+l-93.9%
sub0-neg93.9%
neg-mul-193.9%
associate-/l*93.9%
associate-/r/93.8%
*-commutative93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
distribute-lft-neg-out93.8%
distribute-rgt-neg-in93.8%
Simplified93.7%
Taylor expanded in x around inf 67.2%
associate-*r/67.2%
*-commutative67.2%
associate-*l/67.1%
associate-*r*65.5%
*-commutative65.5%
associate-*l/65.6%
Simplified65.6%
associate-*r/67.2%
*-commutative67.2%
associate-*r*67.2%
*-commutative67.2%
associate-/l*67.2%
Applied egg-rr67.2%
if 4.10000000000000031e94 < t Initial program 89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
neg-mul-189.3%
associate-/l*89.2%
associate-/r/89.3%
*-commutative89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
distribute-lft-neg-out89.3%
distribute-rgt-neg-in89.3%
Simplified89.2%
Taylor expanded in x around 0 67.9%
associate-/l*74.0%
Simplified74.0%
associate-*r/74.1%
Applied egg-rr74.1%
Final simplification69.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -1.5e-101) (* -4.5 (* z (/ t a))) (if (<= t 4.2e+94) (/ (* (* x y) 0.5) a) (/ (* t -4.5) (/ a z)))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e-101) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.2e+94) {
tmp = ((x * y) * 0.5) / a;
} else {
tmp = (t * -4.5) / (a / z);
}
return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.5d-101)) then
tmp = (-4.5d0) * (z * (t / a))
else if (t <= 4.2d+94) then
tmp = ((x * y) * 0.5d0) / a
else
tmp = (t * (-4.5d0)) / (a / z)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e-101) {
tmp = -4.5 * (z * (t / a));
} else if (t <= 4.2e+94) {
tmp = ((x * y) * 0.5) / a;
} else {
tmp = (t * -4.5) / (a / z);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -1.5e-101: tmp = -4.5 * (z * (t / a)) elif t <= 4.2e+94: tmp = ((x * y) * 0.5) / a else: tmp = (t * -4.5) / (a / z) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e-101) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); elseif (t <= 4.2e+94) tmp = Float64(Float64(Float64(x * y) * 0.5) / a); else tmp = Float64(Float64(t * -4.5) / Float64(a / z)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -1.5e-101)
tmp = -4.5 * (z * (t / a));
elseif (t <= 4.2e+94)
tmp = ((x * y) * 0.5) / a;
else
tmp = (t * -4.5) / (a / z);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e-101], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e+94], N[(N[(N[(x * y), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision], N[(N[(t * -4.5), $MachinePrecision] / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-101}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+94}:\\
\;\;\;\;\frac{\left(x \cdot y\right) \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot -4.5}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.5000000000000002e-101Initial program 92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
neg-mul-192.9%
associate-/l*92.4%
associate-/r/92.9%
*-commutative92.9%
sub-neg92.9%
+-commutative92.9%
neg-sub092.9%
associate-+l-92.9%
sub0-neg92.9%
distribute-lft-neg-out92.9%
distribute-rgt-neg-in92.9%
Simplified92.9%
Taylor expanded in x around 0 64.3%
associate-/l*68.3%
Simplified68.3%
associate-/r/70.8%
Applied egg-rr70.8%
if -1.5000000000000002e-101 < t < 4.19999999999999979e94Initial program 93.9%
sub-neg93.9%
+-commutative93.9%
neg-sub093.9%
associate-+l-93.9%
sub0-neg93.9%
neg-mul-193.9%
associate-/l*93.9%
associate-/r/93.8%
*-commutative93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
distribute-lft-neg-out93.8%
distribute-rgt-neg-in93.8%
Simplified93.7%
Taylor expanded in x around inf 67.2%
associate-*r/67.2%
Simplified67.2%
if 4.19999999999999979e94 < t Initial program 89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
neg-mul-189.3%
associate-/l*89.2%
associate-/r/89.3%
*-commutative89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
distribute-lft-neg-out89.3%
distribute-rgt-neg-in89.3%
Simplified89.2%
Taylor expanded in x around 0 67.9%
associate-/l*74.0%
Simplified74.0%
associate-*r/74.1%
Applied egg-rr74.1%
Final simplification69.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (* z (/ t a))))
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (-4.5d0) * (z * (t / a))
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
[z, t] = sort([z, t]) def code(x, y, z, t, a): return -4.5 * (z * (t / a))
z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(z * Float64(t / a))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (z * (t / a));
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
associate-/l*92.5%
associate-/r/92.7%
*-commutative92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
distribute-lft-neg-out92.7%
distribute-rgt-neg-in92.7%
Simplified92.6%
Taylor expanded in x around 0 51.8%
associate-/l*53.8%
Simplified53.8%
associate-/r/55.9%
Applied egg-rr55.9%
Final simplification55.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 2023258
(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)))