
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
NOTE: x, y, z, t, and a 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 (<= t_1 (- INFINITY))
(* t (fma -4.5 (/ z a) (* 0.5 (* (/ x a) (/ y t)))))
(if (<= t_1 5e+300)
(/ (fma x (/ y 2.0) (* t (* z -4.5))) a)
(* -0.5 (* t (/ (fma z 9.0 (* x (/ y (- t)))) a)))))))assert(x < y && y < z && z < t && t < a);
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 <= -((double) INFINITY)) {
tmp = t * fma(-4.5, (z / a), (0.5 * ((x / a) * (y / t))));
} else if (t_1 <= 5e+300) {
tmp = fma(x, (y / 2.0), (t * (z * -4.5))) / a;
} else {
tmp = -0.5 * (t * (fma(z, 9.0, (x * (y / -t))) / a));
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) 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 <= Float64(-Inf)) tmp = Float64(t * fma(-4.5, Float64(z / a), Float64(0.5 * Float64(Float64(x / a) * Float64(y / t))))); elseif (t_1 <= 5e+300) tmp = Float64(fma(x, Float64(y / 2.0), Float64(t * Float64(z * -4.5))) / a); else tmp = Float64(-0.5 * Float64(t * Float64(fma(z, 9.0, Float64(x * Float64(y / Float64(-t)))) / a))); end return tmp end
NOTE: x, y, z, t, and a 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[LessEqual[t$95$1, (-Infinity)], N[(t * N[(-4.5 * N[(z / a), $MachinePrecision] + N[(0.5 * N[(N[(x / a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+300], N[(N[(x * N[(y / 2.0), $MachinePrecision] + N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(t * N[(N[(z * 9.0 + N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-4.5, \frac{z}{a}, 0.5 \cdot \left(\frac{x}{a} \cdot \frac{y}{t}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(t \cdot \frac{\mathsf{fma}\left(z, 9, x \cdot \frac{y}{-t}\right)}{a}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -inf.0Initial program 72.0%
cancel-sign-sub-inv72.0%
fma-define72.0%
distribute-rgt-neg-in72.0%
associate-*r*72.0%
distribute-lft-neg-in72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
metadata-eval72.0%
Simplified72.0%
Taylor expanded in t around inf 86.9%
fma-define86.8%
times-frac99.9%
Simplified99.9%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 5.00000000000000026e300Initial program 98.6%
associate-/l/99.0%
div-sub99.0%
associate-/l*99.0%
fma-neg99.0%
*-commutative99.0%
associate-/l*99.0%
distribute-rgt-neg-out99.0%
distribute-frac-neg99.0%
distribute-rgt-neg-in99.0%
associate-/l*99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
if 5.00000000000000026e300 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 68.9%
cancel-sign-sub-inv68.9%
fma-define71.8%
distribute-rgt-neg-in71.8%
associate-*r*74.4%
distribute-lft-neg-in74.4%
*-commutative74.4%
distribute-rgt-neg-in74.4%
metadata-eval74.4%
Simplified74.4%
Taylor expanded in t around -inf 66.4%
mul-1-neg66.4%
metadata-eval66.4%
cancel-sign-sub-inv66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
cancel-sign-sub-inv66.4%
metadata-eval66.4%
+-commutative66.4%
*-commutative66.4%
mul-1-neg66.4%
unsub-neg66.4%
*-commutative66.4%
associate-/l*69.4%
Simplified69.4%
Taylor expanded in a around 0 66.4%
associate-/l*83.2%
*-commutative83.2%
associate-*r/91.7%
fma-neg91.7%
distribute-rgt-neg-in91.7%
distribute-neg-frac91.7%
Simplified91.7%
Final simplification98.2%
NOTE: x, y, z, t, and a 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)) (* a 2.0))))
(if (<= t_1 -4e+304)
(- (* 0.5 (* y (/ x a))) (* t (* (/ z a) 4.5)))
(if (<= t_1 5e+292)
(/ (fma x (/ y 2.0) (* t (* z -4.5))) a)
(* -0.5 (* t (/ (fma z 9.0 (* x (/ y (- t)))) a)))))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
double tmp;
if (t_1 <= -4e+304) {
tmp = (0.5 * (y * (x / a))) - (t * ((z / a) * 4.5));
} else if (t_1 <= 5e+292) {
tmp = fma(x, (y / 2.0), (t * (z * -4.5))) / a;
} else {
tmp = -0.5 * (t * (fma(z, 9.0, (x * (y / -t))) / a));
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) tmp = 0.0 if (t_1 <= -4e+304) tmp = Float64(Float64(0.5 * Float64(y * Float64(x / a))) - Float64(t * Float64(Float64(z / a) * 4.5))); elseif (t_1 <= 5e+292) tmp = Float64(fma(x, Float64(y / 2.0), Float64(t * Float64(z * -4.5))) / a); else tmp = Float64(-0.5 * Float64(t * Float64(fma(z, 9.0, Float64(x * Float64(y / Float64(-t)))) / a))); end return tmp end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+304], N[(N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(N[(z / a), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+292], N[(N[(x * N[(y / 2.0), $MachinePrecision] + N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(t * N[(N[(z * 9.0 + N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+304}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - t \cdot \left(\frac{z}{a} \cdot 4.5\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(t \cdot \frac{\mathsf{fma}\left(z, 9, x \cdot \frac{y}{-t}\right)}{a}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64))) < -3.9999999999999998e304Initial program 91.8%
cancel-sign-sub-inv91.8%
fma-define91.8%
distribute-rgt-neg-in91.8%
associate-*r*91.8%
distribute-lft-neg-in91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
metadata-eval91.8%
Simplified91.8%
*-commutative91.8%
associate-*r*91.8%
metadata-eval91.8%
distribute-rgt-neg-in91.8%
distribute-lft-neg-in91.8%
fma-neg91.8%
div-sub89.7%
sub-neg89.7%
*-commutative89.7%
associate-/r*89.7%
associate-*r/89.7%
div-inv89.7%
metadata-eval89.7%
associate-*l*89.7%
associate-/l*91.8%
Applied egg-rr91.8%
sub-neg91.8%
*-commutative91.8%
*-commutative91.8%
times-frac91.8%
metadata-eval91.8%
cancel-sign-sub-inv91.8%
distribute-lft-neg-in91.8%
distribute-rgt-neg-in91.8%
*-commutative91.8%
cancel-sign-sub-inv91.8%
associate-*r*91.8%
*-commutative91.8%
associate-*r/91.8%
associate-/l*97.9%
*-commutative97.9%
associate-*r*97.8%
associate-/l*95.8%
*-commutative95.8%
associate-/l*97.8%
associate-*r*97.8%
*-commutative97.8%
Simplified97.8%
clear-num97.8%
inv-pow97.8%
Applied egg-rr97.8%
unpow-197.8%
Simplified97.8%
Taylor expanded in x around 0 91.7%
*-commutative91.7%
associate-/l*91.4%
Simplified91.4%
if -3.9999999999999998e304 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64))) < 4.9999999999999996e292Initial program 98.3%
associate-/l/98.9%
div-sub98.9%
associate-/l*98.9%
fma-neg98.9%
*-commutative98.9%
associate-/l*98.9%
distribute-rgt-neg-out98.9%
distribute-frac-neg98.9%
distribute-rgt-neg-in98.9%
associate-/l*98.9%
metadata-eval98.9%
metadata-eval98.9%
Simplified98.9%
if 4.9999999999999996e292 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64))) Initial program 67.8%
cancel-sign-sub-inv67.8%
fma-define69.9%
distribute-rgt-neg-in69.9%
associate-*r*71.8%
distribute-lft-neg-in71.8%
*-commutative71.8%
distribute-rgt-neg-in71.8%
metadata-eval71.8%
Simplified71.8%
Taylor expanded in t around -inf 68.0%
mul-1-neg68.0%
metadata-eval68.0%
cancel-sign-sub-inv68.0%
*-commutative68.0%
distribute-rgt-neg-in68.0%
cancel-sign-sub-inv68.0%
metadata-eval68.0%
+-commutative68.0%
*-commutative68.0%
mul-1-neg68.0%
unsub-neg68.0%
*-commutative68.0%
associate-/l*70.1%
Simplified70.1%
Taylor expanded in a around 0 68.0%
associate-/l*86.1%
*-commutative86.1%
associate-*r/92.2%
fma-neg92.2%
distribute-rgt-neg-in92.2%
distribute-neg-frac92.2%
Simplified92.2%
Final simplification96.3%
NOTE: x, y, z, t, and a 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))) (t_2 (* t (* (/ z a) 4.5))))
(if (<= t_1 (- INFINITY))
(- (* 0.5 (* y (/ x a))) t_2)
(if (<= t_1 2e+264)
(/ (fma x (/ y 2.0) (* t (* z -4.5))) a)
(- (* 0.5 (/ x (/ a y))) t_2)))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double t_2 = t * ((z / a) * 4.5);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (0.5 * (y * (x / a))) - t_2;
} else if (t_1 <= 2e+264) {
tmp = fma(x, (y / 2.0), (t * (z * -4.5))) / a;
} else {
tmp = (0.5 * (x / (a / y))) - t_2;
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) t_2 = Float64(t * Float64(Float64(z / a) * 4.5)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(0.5 * Float64(y * Float64(x / a))) - t_2); elseif (t_1 <= 2e+264) tmp = Float64(fma(x, Float64(y / 2.0), Float64(t * Float64(z * -4.5))) / a); else tmp = Float64(Float64(0.5 * Float64(x / Float64(a / y))) - t_2); end return tmp end
NOTE: x, y, z, t, and a 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]}, Block[{t$95$2 = N[(t * N[(N[(z / a), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 2e+264], N[(N[(x * N[(y / 2.0), $MachinePrecision] + N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
t_2 := t \cdot \left(\frac{z}{a} \cdot 4.5\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \frac{y}{2}, t \cdot \left(z \cdot -4.5\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}} - t\_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -inf.0Initial program 72.0%
cancel-sign-sub-inv72.0%
fma-define72.0%
distribute-rgt-neg-in72.0%
associate-*r*72.0%
distribute-lft-neg-in72.0%
*-commutative72.0%
distribute-rgt-neg-in72.0%
metadata-eval72.0%
Simplified72.0%
*-commutative72.0%
associate-*r*72.0%
metadata-eval72.0%
distribute-rgt-neg-in72.0%
distribute-lft-neg-in72.0%
fma-neg72.0%
div-sub68.7%
sub-neg68.7%
*-commutative68.7%
associate-/r*68.7%
associate-*r/68.7%
div-inv68.7%
metadata-eval68.7%
associate-*l*68.7%
associate-/l*84.1%
Applied egg-rr84.1%
sub-neg84.1%
*-commutative84.1%
*-commutative84.1%
times-frac84.2%
metadata-eval84.2%
cancel-sign-sub-inv84.2%
distribute-lft-neg-in84.2%
distribute-rgt-neg-in84.2%
*-commutative84.2%
cancel-sign-sub-inv84.2%
associate-*r*84.2%
*-commutative84.2%
associate-*r/84.2%
associate-/l*93.3%
*-commutative93.3%
associate-*r*93.2%
associate-/l*74.5%
*-commutative74.5%
associate-/l*93.1%
associate-*r*93.3%
*-commutative93.3%
Simplified93.3%
clear-num93.3%
inv-pow93.3%
Applied egg-rr93.3%
unpow-193.3%
Simplified93.3%
Taylor expanded in x around 0 84.3%
*-commutative84.3%
associate-/l*96.7%
Simplified96.7%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 2.00000000000000009e264Initial program 98.5%
associate-/l/99.0%
div-sub99.0%
associate-/l*99.0%
fma-neg99.0%
*-commutative99.0%
associate-/l*99.0%
distribute-rgt-neg-out99.0%
distribute-frac-neg99.0%
distribute-rgt-neg-in99.0%
associate-/l*99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
if 2.00000000000000009e264 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 71.4%
cancel-sign-sub-inv71.4%
fma-define74.1%
distribute-rgt-neg-in74.1%
associate-*r*76.5%
distribute-lft-neg-in76.5%
*-commutative76.5%
distribute-rgt-neg-in76.5%
metadata-eval76.5%
Simplified76.5%
*-commutative76.5%
associate-*r*74.1%
metadata-eval74.1%
distribute-rgt-neg-in74.1%
distribute-lft-neg-in74.1%
fma-neg71.4%
div-sub68.7%
sub-neg68.7%
*-commutative68.7%
associate-/r*68.7%
associate-*r/68.7%
div-inv68.7%
metadata-eval68.7%
associate-*l*71.1%
associate-/l*86.7%
Applied egg-rr86.7%
sub-neg86.7%
*-commutative86.7%
*-commutative86.7%
times-frac86.8%
metadata-eval86.8%
cancel-sign-sub-inv86.8%
distribute-lft-neg-in86.8%
distribute-rgt-neg-in86.8%
*-commutative86.8%
cancel-sign-sub-inv86.8%
associate-*r*86.8%
*-commutative86.8%
associate-*r/86.8%
associate-/l*97.1%
*-commutative97.1%
associate-*r*97.0%
associate-/l*79.0%
*-commutative79.0%
associate-/l*94.7%
associate-*r*94.7%
*-commutative94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
Applied egg-rr94.7%
unpow-194.7%
Simplified94.7%
un-div-inv94.7%
Applied egg-rr94.7%
Final simplification98.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (or (<= t_1 -5e+248) (not (<= t_1 2e+264)))
(- (* 0.5 (* x (/ y a))) (* t (* (/ z a) 4.5)))
(/ t_1 (* a 2.0)))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -5e+248) || !(t_1 <= 2e+264)) {
tmp = (0.5 * (x * (y / a))) - (t * ((z / a) * 4.5));
} else {
tmp = t_1 / (a * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, and a 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 <= (-5d+248)) .or. (.not. (t_1 <= 2d+264))) then
tmp = (0.5d0 * (x * (y / a))) - (t * ((z / a) * 4.5d0))
else
tmp = t_1 / (a * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
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 <= -5e+248) || !(t_1 <= 2e+264)) {
tmp = (0.5 * (x * (y / a))) - (t * ((z / a) * 4.5));
} else {
tmp = t_1 / (a * 2.0);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - ((z * 9.0) * t) tmp = 0 if (t_1 <= -5e+248) or not (t_1 <= 2e+264): tmp = (0.5 * (x * (y / a))) - (t * ((z / a) * 4.5)) else: tmp = t_1 / (a * 2.0) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) tmp = 0.0 if ((t_1 <= -5e+248) || !(t_1 <= 2e+264)) tmp = Float64(Float64(0.5 * Float64(x * Float64(y / a))) - Float64(t * Float64(Float64(z / a) * 4.5))); else tmp = Float64(t_1 / Float64(a * 2.0)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - ((z * 9.0) * t);
tmp = 0.0;
if ((t_1 <= -5e+248) || ~((t_1 <= 2e+264)))
tmp = (0.5 * (x * (y / a))) - (t * ((z / a) * 4.5));
else
tmp = t_1 / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+248], N[Not[LessEqual[t$95$1, 2e+264]], $MachinePrecision]], N[(N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(N[(z / a), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+248} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+264}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right) - t \cdot \left(\frac{z}{a} \cdot 4.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -4.9999999999999996e248 or 2.00000000000000009e264 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 75.6%
cancel-sign-sub-inv75.6%
fma-define76.8%
distribute-rgt-neg-in76.8%
associate-*r*77.9%
distribute-lft-neg-in77.9%
*-commutative77.9%
distribute-rgt-neg-in77.9%
metadata-eval77.9%
Simplified77.9%
*-commutative77.9%
associate-*r*76.8%
metadata-eval76.8%
distribute-rgt-neg-in76.8%
distribute-lft-neg-in76.8%
fma-neg75.6%
div-sub73.1%
sub-neg73.1%
*-commutative73.1%
associate-/r*73.1%
associate-*r/73.1%
div-inv73.1%
metadata-eval73.1%
associate-*l*74.2%
associate-/l*87.0%
Applied egg-rr87.0%
sub-neg87.0%
*-commutative87.0%
*-commutative87.0%
times-frac88.1%
metadata-eval88.1%
cancel-sign-sub-inv88.1%
distribute-lft-neg-in88.1%
distribute-rgt-neg-in88.1%
*-commutative88.1%
cancel-sign-sub-inv88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*r/88.1%
associate-/l*96.1%
*-commutative96.1%
associate-*r*96.1%
associate-/l*81.2%
*-commutative81.2%
associate-/l*93.8%
associate-*r*93.9%
*-commutative93.9%
Simplified93.9%
if -4.9999999999999996e248 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 2.00000000000000009e264Initial program 99.0%
Final simplification97.4%
NOTE: x, y, z, t, and a 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))) (t_2 (* t (* (/ z a) 4.5))))
(if (<= t_1 -5e+248)
(- (* 0.5 (* y (/ x a))) t_2)
(if (<= t_1 2e+264) (/ t_1 (* a 2.0)) (- (* 0.5 (/ x (/ a y))) t_2)))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double t_2 = t * ((z / a) * 4.5);
double tmp;
if (t_1 <= -5e+248) {
tmp = (0.5 * (y * (x / a))) - t_2;
} else if (t_1 <= 2e+264) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (0.5 * (x / (a / y))) - t_2;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) - ((z * 9.0d0) * t)
t_2 = t * ((z / a) * 4.5d0)
if (t_1 <= (-5d+248)) then
tmp = (0.5d0 * (y * (x / a))) - t_2
else if (t_1 <= 2d+264) then
tmp = t_1 / (a * 2.0d0)
else
tmp = (0.5d0 * (x / (a / y))) - t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double t_2 = t * ((z / a) * 4.5);
double tmp;
if (t_1 <= -5e+248) {
tmp = (0.5 * (y * (x / a))) - t_2;
} else if (t_1 <= 2e+264) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (0.5 * (x / (a / y))) - t_2;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - ((z * 9.0) * t) t_2 = t * ((z / a) * 4.5) tmp = 0 if t_1 <= -5e+248: tmp = (0.5 * (y * (x / a))) - t_2 elif t_1 <= 2e+264: tmp = t_1 / (a * 2.0) else: tmp = (0.5 * (x / (a / y))) - t_2 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) t_2 = Float64(t * Float64(Float64(z / a) * 4.5)) tmp = 0.0 if (t_1 <= -5e+248) tmp = Float64(Float64(0.5 * Float64(y * Float64(x / a))) - t_2); elseif (t_1 <= 2e+264) tmp = Float64(t_1 / Float64(a * 2.0)); else tmp = Float64(Float64(0.5 * Float64(x / Float64(a / y))) - t_2); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - ((z * 9.0) * t);
t_2 = t * ((z / a) * 4.5);
tmp = 0.0;
if (t_1 <= -5e+248)
tmp = (0.5 * (y * (x / a))) - t_2;
elseif (t_1 <= 2e+264)
tmp = t_1 / (a * 2.0);
else
tmp = (0.5 * (x / (a / y))) - t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a 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]}, Block[{t$95$2 = N[(t * N[(N[(z / a), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+248], N[(N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 2e+264], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
t_2 := t \cdot \left(\frac{z}{a} \cdot 4.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+248}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}} - t\_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -4.9999999999999996e248Initial program 79.0%
cancel-sign-sub-inv79.0%
fma-define79.0%
distribute-rgt-neg-in79.0%
associate-*r*79.0%
distribute-lft-neg-in79.0%
*-commutative79.0%
distribute-rgt-neg-in79.0%
metadata-eval79.0%
Simplified79.0%
*-commutative79.0%
associate-*r*79.0%
metadata-eval79.0%
distribute-rgt-neg-in79.0%
distribute-lft-neg-in79.0%
fma-neg79.0%
div-sub76.8%
sub-neg76.8%
*-commutative76.8%
associate-/r*76.8%
associate-*r/76.8%
div-inv76.8%
metadata-eval76.8%
associate-*l*76.8%
associate-/l*87.1%
Applied egg-rr87.1%
sub-neg87.1%
*-commutative87.1%
*-commutative87.1%
times-frac89.3%
metadata-eval89.3%
cancel-sign-sub-inv89.3%
distribute-lft-neg-in89.3%
distribute-rgt-neg-in89.3%
*-commutative89.3%
cancel-sign-sub-inv89.3%
associate-*r*89.3%
*-commutative89.3%
associate-*r/89.3%
associate-/l*95.3%
*-commutative95.3%
associate-*r*95.4%
associate-/l*82.9%
*-commutative82.9%
associate-/l*93.1%
associate-*r*93.2%
*-commutative93.2%
Simplified93.2%
clear-num93.2%
inv-pow93.2%
Applied egg-rr93.2%
unpow-193.2%
Simplified93.2%
Taylor expanded in x around 0 87.2%
*-commutative87.2%
associate-/l*95.5%
Simplified95.5%
if -4.9999999999999996e248 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 2.00000000000000009e264Initial program 99.0%
if 2.00000000000000009e264 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 71.4%
cancel-sign-sub-inv71.4%
fma-define74.1%
distribute-rgt-neg-in74.1%
associate-*r*76.5%
distribute-lft-neg-in76.5%
*-commutative76.5%
distribute-rgt-neg-in76.5%
metadata-eval76.5%
Simplified76.5%
*-commutative76.5%
associate-*r*74.1%
metadata-eval74.1%
distribute-rgt-neg-in74.1%
distribute-lft-neg-in74.1%
fma-neg71.4%
div-sub68.7%
sub-neg68.7%
*-commutative68.7%
associate-/r*68.7%
associate-*r/68.7%
div-inv68.7%
metadata-eval68.7%
associate-*l*71.1%
associate-/l*86.7%
Applied egg-rr86.7%
sub-neg86.7%
*-commutative86.7%
*-commutative86.7%
times-frac86.8%
metadata-eval86.8%
cancel-sign-sub-inv86.8%
distribute-lft-neg-in86.8%
distribute-rgt-neg-in86.8%
*-commutative86.8%
cancel-sign-sub-inv86.8%
associate-*r*86.8%
*-commutative86.8%
associate-*r/86.8%
associate-/l*97.1%
*-commutative97.1%
associate-*r*97.0%
associate-/l*79.0%
*-commutative79.0%
associate-/l*94.7%
associate-*r*94.7%
*-commutative94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
Applied egg-rr94.7%
unpow-194.7%
Simplified94.7%
un-div-inv94.7%
Applied egg-rr94.7%
Final simplification97.8%
NOTE: x, y, z, t, and a 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))) (t_2 (* t (* (/ z a) 4.5))))
(if (<= t_1 -5e+248)
(- (* 0.5 (* y (/ x a))) t_2)
(if (<= t_1 2e+264) (/ t_1 (* a 2.0)) (- (* 0.5 (* x (/ y a))) t_2)))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double t_2 = t * ((z / a) * 4.5);
double tmp;
if (t_1 <= -5e+248) {
tmp = (0.5 * (y * (x / a))) - t_2;
} else if (t_1 <= 2e+264) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (0.5 * (x * (y / a))) - t_2;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) - ((z * 9.0d0) * t)
t_2 = t * ((z / a) * 4.5d0)
if (t_1 <= (-5d+248)) then
tmp = (0.5d0 * (y * (x / a))) - t_2
else if (t_1 <= 2d+264) then
tmp = t_1 / (a * 2.0d0)
else
tmp = (0.5d0 * (x * (y / a))) - t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double t_2 = t * ((z / a) * 4.5);
double tmp;
if (t_1 <= -5e+248) {
tmp = (0.5 * (y * (x / a))) - t_2;
} else if (t_1 <= 2e+264) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (0.5 * (x * (y / a))) - t_2;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - ((z * 9.0) * t) t_2 = t * ((z / a) * 4.5) tmp = 0 if t_1 <= -5e+248: tmp = (0.5 * (y * (x / a))) - t_2 elif t_1 <= 2e+264: tmp = t_1 / (a * 2.0) else: tmp = (0.5 * (x * (y / a))) - t_2 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) t_2 = Float64(t * Float64(Float64(z / a) * 4.5)) tmp = 0.0 if (t_1 <= -5e+248) tmp = Float64(Float64(0.5 * Float64(y * Float64(x / a))) - t_2); elseif (t_1 <= 2e+264) tmp = Float64(t_1 / Float64(a * 2.0)); else tmp = Float64(Float64(0.5 * Float64(x * Float64(y / a))) - t_2); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - ((z * 9.0) * t);
t_2 = t * ((z / a) * 4.5);
tmp = 0.0;
if (t_1 <= -5e+248)
tmp = (0.5 * (y * (x / a))) - t_2;
elseif (t_1 <= 2e+264)
tmp = t_1 / (a * 2.0);
else
tmp = (0.5 * (x * (y / a))) - t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a 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]}, Block[{t$95$2 = N[(t * N[(N[(z / a), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+248], N[(N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 2e+264], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
t_2 := t \cdot \left(\frac{z}{a} \cdot 4.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+248}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right) - t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+264}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right) - t\_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -4.9999999999999996e248Initial program 79.0%
cancel-sign-sub-inv79.0%
fma-define79.0%
distribute-rgt-neg-in79.0%
associate-*r*79.0%
distribute-lft-neg-in79.0%
*-commutative79.0%
distribute-rgt-neg-in79.0%
metadata-eval79.0%
Simplified79.0%
*-commutative79.0%
associate-*r*79.0%
metadata-eval79.0%
distribute-rgt-neg-in79.0%
distribute-lft-neg-in79.0%
fma-neg79.0%
div-sub76.8%
sub-neg76.8%
*-commutative76.8%
associate-/r*76.8%
associate-*r/76.8%
div-inv76.8%
metadata-eval76.8%
associate-*l*76.8%
associate-/l*87.1%
Applied egg-rr87.1%
sub-neg87.1%
*-commutative87.1%
*-commutative87.1%
times-frac89.3%
metadata-eval89.3%
cancel-sign-sub-inv89.3%
distribute-lft-neg-in89.3%
distribute-rgt-neg-in89.3%
*-commutative89.3%
cancel-sign-sub-inv89.3%
associate-*r*89.3%
*-commutative89.3%
associate-*r/89.3%
associate-/l*95.3%
*-commutative95.3%
associate-*r*95.4%
associate-/l*82.9%
*-commutative82.9%
associate-/l*93.1%
associate-*r*93.2%
*-commutative93.2%
Simplified93.2%
clear-num93.2%
inv-pow93.2%
Applied egg-rr93.2%
unpow-193.2%
Simplified93.2%
Taylor expanded in x around 0 87.2%
*-commutative87.2%
associate-/l*95.5%
Simplified95.5%
if -4.9999999999999996e248 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 2.00000000000000009e264Initial program 99.0%
if 2.00000000000000009e264 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 71.4%
cancel-sign-sub-inv71.4%
fma-define74.1%
distribute-rgt-neg-in74.1%
associate-*r*76.5%
distribute-lft-neg-in76.5%
*-commutative76.5%
distribute-rgt-neg-in76.5%
metadata-eval76.5%
Simplified76.5%
*-commutative76.5%
associate-*r*74.1%
metadata-eval74.1%
distribute-rgt-neg-in74.1%
distribute-lft-neg-in74.1%
fma-neg71.4%
div-sub68.7%
sub-neg68.7%
*-commutative68.7%
associate-/r*68.7%
associate-*r/68.7%
div-inv68.7%
metadata-eval68.7%
associate-*l*71.1%
associate-/l*86.7%
Applied egg-rr86.7%
sub-neg86.7%
*-commutative86.7%
*-commutative86.7%
times-frac86.8%
metadata-eval86.8%
cancel-sign-sub-inv86.8%
distribute-lft-neg-in86.8%
distribute-rgt-neg-in86.8%
*-commutative86.8%
cancel-sign-sub-inv86.8%
associate-*r*86.8%
*-commutative86.8%
associate-*r/86.8%
associate-/l*97.1%
*-commutative97.1%
associate-*r*97.0%
associate-/l*79.0%
*-commutative79.0%
associate-/l*94.7%
associate-*r*94.7%
*-commutative94.7%
Simplified94.7%
Final simplification97.8%
NOTE: x, y, z, t, and a 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))
(* (/ z a) (* t -4.5))
(if (<= t_1 5e+200)
(/ (- (* x y) t_1) (* a 2.0))
(* t (/ (* z -4.5) a))))))assert(x < y && y < z && z < t && t < a);
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 = (z / a) * (t * -4.5);
} else if (t_1 <= 5e+200) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = t * ((z * -4.5) / a);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
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 = (z / a) * (t * -4.5);
} else if (t_1 <= 5e+200) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = t * ((z * -4.5) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (z * 9.0) * t tmp = 0 if t_1 <= -math.inf: tmp = (z / a) * (t * -4.5) elif t_1 <= 5e+200: tmp = ((x * y) - t_1) / (a * 2.0) else: tmp = t * ((z * -4.5) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) 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(Float64(z / a) * Float64(t * -4.5)); elseif (t_1 <= 5e+200) tmp = Float64(Float64(Float64(x * y) - t_1) / Float64(a * 2.0)); else tmp = Float64(t * Float64(Float64(z * -4.5) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (z * 9.0) * t;
tmp = 0.0;
if (t_1 <= -Inf)
tmp = (z / a) * (t * -4.5);
elseif (t_1 <= 5e+200)
tmp = ((x * y) - t_1) / (a * 2.0);
else
tmp = t * ((z * -4.5) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a 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[(N[(z / a), $MachinePrecision] * N[(t * -4.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+200], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(z * -4.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+200}:\\
\;\;\;\;\frac{x \cdot y - t\_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z \cdot -4.5}{a}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < -inf.0Initial program 62.6%
cancel-sign-sub-inv62.6%
fma-define66.9%
distribute-rgt-neg-in66.9%
associate-*r*70.8%
distribute-lft-neg-in70.8%
*-commutative70.8%
distribute-rgt-neg-in70.8%
metadata-eval70.8%
Simplified70.8%
Taylor expanded in x around 0 75.0%
associate-/l*91.6%
*-commutative91.6%
associate-*l*91.6%
*-commutative91.6%
associate-*l*91.7%
*-commutative91.7%
Simplified91.7%
if -inf.0 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 5.00000000000000019e200Initial program 97.8%
if 5.00000000000000019e200 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 73.0%
cancel-sign-sub-inv73.0%
fma-define73.0%
distribute-rgt-neg-in73.0%
associate-*r*73.0%
distribute-lft-neg-in73.0%
*-commutative73.0%
distribute-rgt-neg-in73.0%
metadata-eval73.0%
Simplified73.0%
clear-num73.1%
inv-pow73.1%
Applied egg-rr73.1%
unpow-173.1%
associate-/l*76.0%
fma-define76.0%
+-commutative76.0%
fma-define76.1%
Simplified76.1%
Taylor expanded in z around inf 76.1%
metadata-eval76.1%
associate-*r/87.5%
distribute-lft-neg-in87.5%
*-commutative87.5%
*-commutative87.5%
associate-*r*87.5%
*-commutative87.5%
associate-*l*87.6%
*-commutative87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
associate-*r/87.6%
distribute-frac-neg87.6%
*-commutative87.6%
distribute-rgt-neg-in87.6%
metadata-eval87.6%
Simplified87.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+18) (* (/ x a) (* y 0.5)) (if (<= (* x y) 1e-15) (/ (* -4.5 (* z t)) a) (/ (* y (* x 0.5)) a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+18) {
tmp = (x / a) * (y * 0.5);
} else if ((x * y) <= 1e-15) {
tmp = (-4.5 * (z * t)) / a;
} else {
tmp = (y * (x * 0.5)) / a;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x * y) <= (-2d+18)) then
tmp = (x / a) * (y * 0.5d0)
else if ((x * y) <= 1d-15) then
tmp = ((-4.5d0) * (z * t)) / a
else
tmp = (y * (x * 0.5d0)) / a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+18) {
tmp = (x / a) * (y * 0.5);
} else if ((x * y) <= 1e-15) {
tmp = (-4.5 * (z * t)) / a;
} else {
tmp = (y * (x * 0.5)) / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+18: tmp = (x / a) * (y * 0.5) elif (x * y) <= 1e-15: tmp = (-4.5 * (z * t)) / a else: tmp = (y * (x * 0.5)) / a return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+18) tmp = Float64(Float64(x / a) * Float64(y * 0.5)); elseif (Float64(x * y) <= 1e-15) tmp = Float64(Float64(-4.5 * Float64(z * t)) / a); else tmp = Float64(Float64(y * Float64(x * 0.5)) / a); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+18)
tmp = (x / a) * (y * 0.5);
elseif ((x * y) <= 1e-15)
tmp = (-4.5 * (z * t)) / a;
else
tmp = (y * (x * 0.5)) / a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+18], N[(N[(x / a), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-15], N[(N[(-4.5 * N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(y * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{a} \cdot \left(y \cdot 0.5\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-15}:\\
\;\;\;\;\frac{-4.5 \cdot \left(z \cdot t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(x \cdot 0.5\right)}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -2e18Initial program 86.0%
associate-/l/86.0%
div-sub86.0%
associate-/l*86.0%
fma-neg87.6%
*-commutative87.6%
associate-/l*87.6%
distribute-rgt-neg-out87.6%
distribute-frac-neg87.6%
distribute-rgt-neg-in87.6%
associate-/l*87.6%
metadata-eval87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in x around inf 70.5%
associate-*r*70.5%
*-commutative70.5%
Simplified70.5%
*-commutative70.5%
associate-*l*70.5%
associate-*r/70.5%
*-commutative70.5%
associate-*r/69.4%
*-commutative69.4%
*-commutative69.4%
associate-*l*69.4%
Applied egg-rr69.4%
if -2e18 < (*.f64 x y) < 1.0000000000000001e-15Initial program 93.3%
associate-/l/94.0%
div-sub94.0%
associate-/l*94.0%
fma-neg94.0%
*-commutative94.0%
associate-/l*94.0%
distribute-rgt-neg-out94.0%
distribute-frac-neg94.0%
distribute-rgt-neg-in94.0%
associate-/l*94.7%
metadata-eval94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in x around 0 82.5%
if 1.0000000000000001e-15 < (*.f64 x y) Initial program 93.1%
associate-/l/93.1%
div-sub93.1%
associate-/l*93.1%
fma-neg93.1%
*-commutative93.1%
associate-/l*93.1%
distribute-rgt-neg-out93.1%
distribute-frac-neg93.1%
distribute-rgt-neg-in93.1%
associate-/l*93.1%
metadata-eval93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in x around inf 74.6%
associate-*r*74.6%
*-commutative74.6%
Simplified74.6%
Final simplification77.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= x -4.5e+106) (not (<= x 1.25e-90))) (* (/ x a) (* y 0.5)) (/ (* -4.5 (* z t)) a)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4.5e+106) || !(x <= 1.25e-90)) {
tmp = (x / a) * (y * 0.5);
} else {
tmp = (-4.5 * (z * t)) / a;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-4.5d+106)) .or. (.not. (x <= 1.25d-90))) then
tmp = (x / a) * (y * 0.5d0)
else
tmp = ((-4.5d0) * (z * t)) / a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4.5e+106) || !(x <= 1.25e-90)) {
tmp = (x / a) * (y * 0.5);
} else {
tmp = (-4.5 * (z * t)) / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x <= -4.5e+106) or not (x <= 1.25e-90): tmp = (x / a) * (y * 0.5) else: tmp = (-4.5 * (z * t)) / a return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((x <= -4.5e+106) || !(x <= 1.25e-90)) tmp = Float64(Float64(x / a) * Float64(y * 0.5)); else tmp = Float64(Float64(-4.5 * Float64(z * t)) / a); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x <= -4.5e+106) || ~((x <= 1.25e-90)))
tmp = (x / a) * (y * 0.5);
else
tmp = (-4.5 * (z * t)) / a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -4.5e+106], N[Not[LessEqual[x, 1.25e-90]], $MachinePrecision]], N[(N[(x / a), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(-4.5 * N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+106} \lor \neg \left(x \leq 1.25 \cdot 10^{-90}\right):\\
\;\;\;\;\frac{x}{a} \cdot \left(y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-4.5 \cdot \left(z \cdot t\right)}{a}\\
\end{array}
\end{array}
if x < -4.4999999999999997e106 or 1.25000000000000005e-90 < x Initial program 88.5%
associate-/l/88.5%
div-sub88.5%
associate-/l*88.5%
fma-neg89.3%
*-commutative89.3%
associate-/l*89.3%
distribute-rgt-neg-out89.3%
distribute-frac-neg89.3%
distribute-rgt-neg-in89.3%
associate-/l*90.0%
metadata-eval90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x around inf 59.7%
associate-*r*59.7%
*-commutative59.7%
Simplified59.7%
*-commutative59.7%
associate-*l*59.7%
associate-*r/59.7%
*-commutative59.7%
associate-*r/61.9%
*-commutative61.9%
*-commutative61.9%
associate-*l*61.9%
Applied egg-rr61.9%
if -4.4999999999999997e106 < x < 1.25000000000000005e-90Initial program 94.5%
associate-/l/95.2%
div-sub95.2%
associate-/l*95.2%
fma-neg95.2%
*-commutative95.2%
associate-/l*95.2%
distribute-rgt-neg-out95.2%
distribute-frac-neg95.2%
distribute-rgt-neg-in95.2%
associate-/l*95.2%
metadata-eval95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in x around 0 75.7%
Final simplification68.8%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= x -1.45e+107) (not (<= x 9e-91))) (* (/ x a) (* y 0.5)) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.45e+107) || !(x <= 9e-91)) {
tmp = (x / a) * (y * 0.5);
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-1.45d+107)) .or. (.not. (x <= 9d-91))) then
tmp = (x / a) * (y * 0.5d0)
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.45e+107) || !(x <= 9e-91)) {
tmp = (x / a) * (y * 0.5);
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x <= -1.45e+107) or not (x <= 9e-91): tmp = (x / a) * (y * 0.5) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((x <= -1.45e+107) || !(x <= 9e-91)) tmp = Float64(Float64(x / a) * Float64(y * 0.5)); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x <= -1.45e+107) || ~((x <= 9e-91)))
tmp = (x / a) * (y * 0.5);
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.45e+107], N[Not[LessEqual[x, 9e-91]], $MachinePrecision]], N[(N[(x / a), $MachinePrecision] * N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+107} \lor \neg \left(x \leq 9 \cdot 10^{-91}\right):\\
\;\;\;\;\frac{x}{a} \cdot \left(y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if x < -1.44999999999999994e107 or 8.99999999999999952e-91 < x Initial program 88.5%
associate-/l/88.5%
div-sub88.5%
associate-/l*88.5%
fma-neg89.3%
*-commutative89.3%
associate-/l*89.3%
distribute-rgt-neg-out89.3%
distribute-frac-neg89.3%
distribute-rgt-neg-in89.3%
associate-/l*90.0%
metadata-eval90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x around inf 59.7%
associate-*r*59.7%
*-commutative59.7%
Simplified59.7%
*-commutative59.7%
associate-*l*59.7%
associate-*r/59.7%
*-commutative59.7%
associate-*r/61.9%
*-commutative61.9%
*-commutative61.9%
associate-*l*61.9%
Applied egg-rr61.9%
if -1.44999999999999994e107 < x < 8.99999999999999952e-91Initial program 94.5%
cancel-sign-sub-inv94.5%
fma-define94.5%
distribute-rgt-neg-in94.5%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
metadata-eval94.4%
Simplified94.4%
Taylor expanded in x around 0 75.7%
Final simplification68.8%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= x -2.8e+138) (not (<= x 1.25e-90))) (* 0.5 (* x (/ y a))) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.8e+138) || !(x <= 1.25e-90)) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-2.8d+138)) .or. (.not. (x <= 1.25d-90))) then
tmp = 0.5d0 * (x * (y / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.8e+138) || !(x <= 1.25e-90)) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x <= -2.8e+138) or not (x <= 1.25e-90): tmp = 0.5 * (x * (y / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.8e+138) || !(x <= 1.25e-90)) tmp = Float64(0.5 * Float64(x * Float64(y / a))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x <= -2.8e+138) || ~((x <= 1.25e-90)))
tmp = 0.5 * (x * (y / a));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.8e+138], N[Not[LessEqual[x, 1.25e-90]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+138} \lor \neg \left(x \leq 1.25 \cdot 10^{-90}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if x < -2.8000000000000001e138 or 1.25000000000000005e-90 < x Initial program 87.7%
cancel-sign-sub-inv87.7%
fma-define88.6%
distribute-rgt-neg-in88.6%
associate-*r*89.4%
distribute-lft-neg-in89.4%
*-commutative89.4%
distribute-rgt-neg-in89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in x around inf 59.4%
associate-/l*59.3%
Simplified59.3%
if -2.8000000000000001e138 < x < 1.25000000000000005e-90Initial program 94.8%
cancel-sign-sub-inv94.8%
fma-define94.8%
distribute-rgt-neg-in94.8%
associate-*r*94.8%
distribute-lft-neg-in94.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in x around 0 74.2%
Final simplification67.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= a 1.7e+244) (* -4.5 (/ (* z t) a)) (* -4.5 (* t (/ z a)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.7e+244) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = -4.5 * (t * (z / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= 1.7d+244) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = (-4.5d0) * (t * (z / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.7e+244) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = -4.5 * (t * (z / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if a <= 1.7e+244: tmp = -4.5 * ((z * t) / a) else: tmp = -4.5 * (t * (z / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.7e+244) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(-4.5 * Float64(t * Float64(z / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (a <= 1.7e+244)
tmp = -4.5 * ((z * t) / a);
else
tmp = -4.5 * (t * (z / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.7e+244], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.7 \cdot 10^{+244}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\end{array}
\end{array}
if a < 1.70000000000000005e244Initial program 93.2%
cancel-sign-sub-inv93.2%
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%
Taylor expanded in x around 0 57.6%
if 1.70000000000000005e244 < a Initial program 72.3%
cancel-sign-sub-inv72.3%
fma-define72.3%
distribute-rgt-neg-in72.3%
associate-*r*72.3%
distribute-lft-neg-in72.3%
*-commutative72.3%
distribute-rgt-neg-in72.3%
metadata-eval72.3%
Simplified72.3%
Taylor expanded in x around 0 50.0%
associate-/l*45.7%
Simplified45.7%
Final simplification56.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (* t (/ z a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (-4.5d0) * (t * (z / a))
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return -4.5 * (t * (z / a))
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(t * Float64(z / a))) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (t * (z / a));
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-4.5 \cdot \left(t \cdot \frac{z}{a}\right)
\end{array}
Initial program 91.5%
cancel-sign-sub-inv91.5%
fma-define91.9%
distribute-rgt-neg-in91.9%
associate-*r*92.2%
distribute-lft-neg-in92.2%
*-commutative92.2%
distribute-rgt-neg-in92.2%
metadata-eval92.2%
Simplified92.2%
Taylor expanded in x around 0 57.0%
associate-/l*54.9%
Simplified54.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 2024143
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:alt
(! :herbie-platform default (if (< a -209046455797670900000000000000000000000000000000000000000000000000000000000000000000000) (- (* 1/2 (/ (* y x) a)) (* 9/2 (/ t (/ a z)))) (if (< a 2144030707833976000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z (* 9 t))) (* a 2)) (- (* (/ y a) (* x 1/2)) (* (/ t a) (* z 9/2))))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))