
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)) INFINITY) (+ (fma x y (/ t (/ 16.0 z))) (- c (/ a (/ 4.0 b)))) (fma y x (* (* a b) -0.25))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
tmp = fma(x, y, (t / (16.0 / z))) + (c - (a / (4.0 / b)));
} else {
tmp = fma(y, x, ((a * b) * -0.25));
}
return tmp;
}
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) <= Inf) tmp = Float64(fma(x, y, Float64(t / Float64(16.0 / z))) + Float64(c - Float64(a / Float64(4.0 / b)))); else tmp = fma(y, x, Float64(Float64(a * b) * -0.25)); end return tmp end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(t / N[(16.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(a \cdot b\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 99.6%
associate-+l-99.6%
fma-def99.6%
*-commutative99.6%
associate-/l*99.9%
associate-/l*99.9%
Simplified99.9%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
associate-+l-0.0%
associate--l+0.0%
fma-def37.5%
associate-*l/37.5%
fma-neg50.0%
sub-neg50.0%
distribute-neg-in50.0%
remove-double-neg50.0%
associate-/l*50.0%
distribute-frac-neg50.0%
associate-/r/50.0%
fma-def50.0%
neg-mul-150.0%
*-commutative50.0%
associate-/l*50.0%
metadata-eval50.0%
Simplified50.0%
Taylor expanded in z around 0 62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
+-commutative62.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
associate-*r*62.5%
*-commutative62.5%
fma-udef62.5%
Simplified62.5%
Taylor expanded in c around 0 37.5%
fma-def62.5%
Simplified62.5%
Final simplification98.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 96.5%
associate-+l-96.5%
associate--l+96.5%
fma-def97.7%
associate-*l/98.0%
fma-neg98.4%
sub-neg98.4%
distribute-neg-in98.4%
remove-double-neg98.4%
associate-/l*98.4%
distribute-frac-neg98.4%
associate-/r/98.4%
fma-def98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma y x (* (* a b) -0.25)))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = fma(y, x, ((a * b) * -0.25));
}
return tmp;
}
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = fma(y, x, Float64(Float64(a * b) * -0.25)); end return tmp end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(y * x + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(a \cdot b\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 99.6%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
associate-+l-0.0%
associate--l+0.0%
fma-def37.5%
associate-*l/37.5%
fma-neg50.0%
sub-neg50.0%
distribute-neg-in50.0%
remove-double-neg50.0%
associate-/l*50.0%
distribute-frac-neg50.0%
associate-/r/50.0%
fma-def50.0%
neg-mul-150.0%
*-commutative50.0%
associate-/l*50.0%
metadata-eval50.0%
Simplified50.0%
Taylor expanded in z around 0 62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
+-commutative62.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
associate-*r*62.5%
*-commutative62.5%
fma-udef62.5%
Simplified62.5%
Taylor expanded in c around 0 37.5%
fma-def62.5%
Simplified62.5%
Final simplification98.5%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (* (* z t) 0.0625))))
(if (<= (* a b) -1e+78)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) -4e-69)
(+ c (* x y))
(if (<= (* a b) -2e-141)
t_1
(if (<= (* a b) -5e-241)
(+ c (* t (* z 0.0625)))
(if (<= (* a b) 1e+47) t_1 (+ c (* b (* a -0.25))))))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) * 0.0625);
double tmp;
if ((a * b) <= -1e+78) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= -4e-69) {
tmp = c + (x * y);
} else if ((a * b) <= -2e-141) {
tmp = t_1;
} else if ((a * b) <= -5e-241) {
tmp = c + (t * (z * 0.0625));
} else if ((a * b) <= 1e+47) {
tmp = t_1;
} else {
tmp = c + (b * (a * -0.25));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + ((z * t) * 0.0625d0)
if ((a * b) <= (-1d+78)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= (-4d-69)) then
tmp = c + (x * y)
else if ((a * b) <= (-2d-141)) then
tmp = t_1
else if ((a * b) <= (-5d-241)) then
tmp = c + (t * (z * 0.0625d0))
else if ((a * b) <= 1d+47) then
tmp = t_1
else
tmp = c + (b * (a * (-0.25d0)))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) * 0.0625);
double tmp;
if ((a * b) <= -1e+78) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= -4e-69) {
tmp = c + (x * y);
} else if ((a * b) <= -2e-141) {
tmp = t_1;
} else if ((a * b) <= -5e-241) {
tmp = c + (t * (z * 0.0625));
} else if ((a * b) <= 1e+47) {
tmp = t_1;
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = (x * y) + ((z * t) * 0.0625) tmp = 0 if (a * b) <= -1e+78: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= -4e-69: tmp = c + (x * y) elif (a * b) <= -2e-141: tmp = t_1 elif (a * b) <= -5e-241: tmp = c + (t * (z * 0.0625)) elif (a * b) <= 1e+47: tmp = t_1 else: tmp = c + (b * (a * -0.25)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625)) tmp = 0.0 if (Float64(a * b) <= -1e+78) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= -4e-69) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= -2e-141) tmp = t_1; elseif (Float64(a * b) <= -5e-241) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(a * b) <= 1e+47) tmp = t_1; else tmp = Float64(c + Float64(b * Float64(a * -0.25))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * y) + ((z * t) * 0.0625);
tmp = 0.0;
if ((a * b) <= -1e+78)
tmp = (x * y) - ((a * b) * 0.25);
elseif ((a * b) <= -4e-69)
tmp = c + (x * y);
elseif ((a * b) <= -2e-141)
tmp = t_1;
elseif ((a * b) <= -5e-241)
tmp = c + (t * (z * 0.0625));
elseif ((a * b) <= 1e+47)
tmp = t_1;
else
tmp = c + (b * (a * -0.25));
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_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+78], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4e-69], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2e-141], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -5e-241], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+47], t$95$1, N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+78}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-69}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-241}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000001e78Initial program 93.6%
Taylor expanded in z around 0 78.4%
Taylor expanded in c around 0 71.6%
if -1.00000000000000001e78 < (*.f64 a b) < -3.9999999999999999e-69Initial program 96.2%
Taylor expanded in x around inf 67.5%
if -3.9999999999999999e-69 < (*.f64 a b) < -2.0000000000000001e-141 or -4.9999999999999998e-241 < (*.f64 a b) < 1e47Initial program 98.2%
associate-+l-98.2%
associate--l+98.2%
fma-def98.2%
associate-*l/99.0%
fma-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
associate-/l*99.0%
distribute-frac-neg99.0%
associate-/r/99.0%
fma-def99.0%
neg-mul-199.0%
*-commutative99.0%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in a around 0 96.4%
Taylor expanded in c around 0 74.1%
if -2.0000000000000001e-141 < (*.f64 a b) < -4.9999999999999998e-241Initial program 100.0%
Taylor expanded in z around inf 93.6%
*-commutative93.6%
associate-*r*93.6%
*-commutative93.6%
Simplified93.6%
if 1e47 < (*.f64 a b) Initial program 95.7%
Taylor expanded in a around inf 82.4%
associate-*r*82.4%
*-commutative82.4%
Simplified82.4%
Final simplification75.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* a b) -5e+158)
t_1
(if (<= (* a b) 1e+47)
(+ c (+ (* x y) (* (* z t) 0.0625)))
(if (<= (* a b) 5e+99)
(+ c (* b (* a -0.25)))
(if (<= (* a b) 1e+134)
(+ c (* x y))
(if (<= (* a b) 5e+198) t_1 (* (* a b) -0.25))))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -5e+158) {
tmp = t_1;
} else if ((a * b) <= 1e+47) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else if ((a * b) <= 5e+99) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+134) {
tmp = c + (x * y);
} else if ((a * b) <= 5e+198) {
tmp = t_1;
} else {
tmp = (a * b) * -0.25;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) - ((a * b) * 0.25d0)
if ((a * b) <= (-5d+158)) then
tmp = t_1
else if ((a * b) <= 1d+47) then
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
else if ((a * b) <= 5d+99) then
tmp = c + (b * (a * (-0.25d0)))
else if ((a * b) <= 1d+134) then
tmp = c + (x * y)
else if ((a * b) <= 5d+198) then
tmp = t_1
else
tmp = (a * b) * (-0.25d0)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -5e+158) {
tmp = t_1;
} else if ((a * b) <= 1e+47) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else if ((a * b) <= 5e+99) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+134) {
tmp = c + (x * y);
} else if ((a * b) <= 5e+198) {
tmp = t_1;
} else {
tmp = (a * b) * -0.25;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if (a * b) <= -5e+158: tmp = t_1 elif (a * b) <= 1e+47: tmp = c + ((x * y) + ((z * t) * 0.0625)) elif (a * b) <= 5e+99: tmp = c + (b * (a * -0.25)) elif (a * b) <= 1e+134: tmp = c + (x * y) elif (a * b) <= 5e+198: tmp = t_1 else: tmp = (a * b) * -0.25 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(a * b) <= -5e+158) tmp = t_1; elseif (Float64(a * b) <= 1e+47) tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); elseif (Float64(a * b) <= 5e+99) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(a * b) <= 1e+134) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 5e+198) tmp = t_1; else tmp = Float64(Float64(a * b) * -0.25); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * y) - ((a * b) * 0.25);
tmp = 0.0;
if ((a * b) <= -5e+158)
tmp = t_1;
elseif ((a * b) <= 1e+47)
tmp = c + ((x * y) + ((z * t) * 0.0625));
elseif ((a * b) <= 5e+99)
tmp = c + (b * (a * -0.25));
elseif ((a * b) <= 1e+134)
tmp = c + (x * y);
elseif ((a * b) <= 5e+198)
tmp = t_1;
else
tmp = (a * b) * -0.25;
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_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+158], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e+47], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+99], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+134], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+198], t$95$1, N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 10^{+47}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+99}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+134}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+198}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999996e158 or 9.99999999999999921e133 < (*.f64 a b) < 5.00000000000000049e198Initial program 92.4%
Taylor expanded in z around 0 81.5%
Taylor expanded in c around 0 77.1%
if -4.9999999999999996e158 < (*.f64 a b) < 1e47Initial program 98.2%
Taylor expanded in a around 0 90.7%
if 1e47 < (*.f64 a b) < 5.00000000000000008e99Initial program 100.0%
Taylor expanded in a around inf 90.7%
associate-*r*90.7%
*-commutative90.7%
Simplified90.7%
if 5.00000000000000008e99 < (*.f64 a b) < 9.99999999999999921e133Initial program 100.0%
Taylor expanded in x around inf 91.3%
if 5.00000000000000049e198 < (*.f64 a b) Initial program 90.0%
associate-+l-90.0%
associate--l+90.0%
fma-def100.0%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 95.0%
metadata-eval95.0%
distribute-lft-neg-in95.0%
+-commutative95.0%
distribute-lft-neg-in95.0%
metadata-eval95.0%
associate-*r*95.0%
*-commutative95.0%
fma-udef95.0%
Simplified95.0%
Taylor expanded in a around inf 95.0%
Final simplification88.2%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* (* z t) 0.0625)))
(if (<= (* a b) -5e+158)
(- (* x y) t_1)
(if (<= (* a b) 1e+47)
(+ c (+ (* x y) t_2))
(if (<= (* a b) 5e+99)
(+ c (* b (* a -0.25)))
(if (<= (* a b) 1e+134) (+ c (* x y)) (- t_2 t_1)))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5e+158) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 1e+47) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 5e+99) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+134) {
tmp = c + (x * y);
} else {
tmp = t_2 - t_1;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = (z * t) * 0.0625d0
if ((a * b) <= (-5d+158)) then
tmp = (x * y) - t_1
else if ((a * b) <= 1d+47) then
tmp = c + ((x * y) + t_2)
else if ((a * b) <= 5d+99) then
tmp = c + (b * (a * (-0.25d0)))
else if ((a * b) <= 1d+134) then
tmp = c + (x * y)
else
tmp = t_2 - t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5e+158) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 1e+47) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 5e+99) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+134) {
tmp = c + (x * y);
} else {
tmp = t_2 - t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = (z * t) * 0.0625 tmp = 0 if (a * b) <= -5e+158: tmp = (x * y) - t_1 elif (a * b) <= 1e+47: tmp = c + ((x * y) + t_2) elif (a * b) <= 5e+99: tmp = c + (b * (a * -0.25)) elif (a * b) <= 1e+134: tmp = c + (x * y) else: tmp = t_2 - t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (Float64(a * b) <= -5e+158) tmp = Float64(Float64(x * y) - t_1); elseif (Float64(a * b) <= 1e+47) tmp = Float64(c + Float64(Float64(x * y) + t_2)); elseif (Float64(a * b) <= 5e+99) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(a * b) <= 1e+134) tmp = Float64(c + Float64(x * y)); else tmp = Float64(t_2 - t_1); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (a * b) * 0.25;
t_2 = (z * t) * 0.0625;
tmp = 0.0;
if ((a * b) <= -5e+158)
tmp = (x * y) - t_1;
elseif ((a * b) <= 1e+47)
tmp = c + ((x * y) + t_2);
elseif ((a * b) <= 5e+99)
tmp = c + (b * (a * -0.25));
elseif ((a * b) <= 1e+134)
tmp = c + (x * y);
else
tmp = t_2 - t_1;
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_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+158], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+47], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+99], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+134], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+158}:\\
\;\;\;\;x \cdot y - t_1\\
\mathbf{elif}\;a \cdot b \leq 10^{+47}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+99}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+134}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999996e158Initial program 91.1%
Taylor expanded in z around 0 80.4%
Taylor expanded in c around 0 75.3%
if -4.9999999999999996e158 < (*.f64 a b) < 1e47Initial program 98.2%
Taylor expanded in a around 0 90.7%
if 1e47 < (*.f64 a b) < 5.00000000000000008e99Initial program 100.0%
Taylor expanded in a around inf 90.7%
associate-*r*90.7%
*-commutative90.7%
Simplified90.7%
if 5.00000000000000008e99 < (*.f64 a b) < 9.99999999999999921e133Initial program 100.0%
Taylor expanded in x around inf 91.3%
if 9.99999999999999921e133 < (*.f64 a b) Initial program 92.9%
Taylor expanded in x around 0 93.2%
Taylor expanded in c around 0 93.0%
Final simplification88.3%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) -0.25)))
(if (<= (* a b) -5.6e+77)
t_1
(if (<= (* a b) -2.3e-70)
c
(if (<= (* a b) -1e-129)
(* (* z t) 0.0625)
(if (<= (* a b) -2.9e-243)
c
(if (<= (* a b) 2.35e+55) (* x y) t_1)))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -5.6e+77) {
tmp = t_1;
} else if ((a * b) <= -2.3e-70) {
tmp = c;
} else if ((a * b) <= -1e-129) {
tmp = (z * t) * 0.0625;
} else if ((a * b) <= -2.9e-243) {
tmp = c;
} else if ((a * b) <= 2.35e+55) {
tmp = x * y;
} else {
tmp = t_1;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) * (-0.25d0)
if ((a * b) <= (-5.6d+77)) then
tmp = t_1
else if ((a * b) <= (-2.3d-70)) then
tmp = c
else if ((a * b) <= (-1d-129)) then
tmp = (z * t) * 0.0625d0
else if ((a * b) <= (-2.9d-243)) then
tmp = c
else if ((a * b) <= 2.35d+55) then
tmp = x * y
else
tmp = t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -5.6e+77) {
tmp = t_1;
} else if ((a * b) <= -2.3e-70) {
tmp = c;
} else if ((a * b) <= -1e-129) {
tmp = (z * t) * 0.0625;
} else if ((a * b) <= -2.9e-243) {
tmp = c;
} else if ((a * b) <= 2.35e+55) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = (a * b) * -0.25 tmp = 0 if (a * b) <= -5.6e+77: tmp = t_1 elif (a * b) <= -2.3e-70: tmp = c elif (a * b) <= -1e-129: tmp = (z * t) * 0.0625 elif (a * b) <= -2.9e-243: tmp = c elif (a * b) <= 2.35e+55: tmp = x * y else: tmp = t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(a * b) <= -5.6e+77) tmp = t_1; elseif (Float64(a * b) <= -2.3e-70) tmp = c; elseif (Float64(a * b) <= -1e-129) tmp = Float64(Float64(z * t) * 0.0625); elseif (Float64(a * b) <= -2.9e-243) tmp = c; elseif (Float64(a * b) <= 2.35e+55) tmp = Float64(x * y); else tmp = t_1; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (a * b) * -0.25;
tmp = 0.0;
if ((a * b) <= -5.6e+77)
tmp = t_1;
elseif ((a * b) <= -2.3e-70)
tmp = c;
elseif ((a * b) <= -1e-129)
tmp = (z * t) * 0.0625;
elseif ((a * b) <= -2.9e-243)
tmp = c;
elseif ((a * b) <= 2.35e+55)
tmp = x * y;
else
tmp = t_1;
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_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5.6e+77], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2.3e-70], c, If[LessEqual[N[(a * b), $MachinePrecision], -1e-129], N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.9e-243], c, If[LessEqual[N[(a * b), $MachinePrecision], 2.35e+55], N[(x * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -5.6 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -2.3 \cdot 10^{-70}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-129}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\
\mathbf{elif}\;a \cdot b \leq -2.9 \cdot 10^{-243}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \cdot b \leq 2.35 \cdot 10^{+55}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.60000000000000001e77 or 2.35e55 < (*.f64 a b) Initial program 94.5%
associate-+l-94.5%
associate--l+94.5%
fma-def97.2%
associate-*l/97.2%
fma-neg98.2%
sub-neg98.2%
distribute-neg-in98.2%
remove-double-neg98.2%
associate-/l*98.1%
distribute-frac-neg98.1%
associate-/r/98.2%
fma-def98.2%
neg-mul-198.2%
*-commutative98.2%
associate-/l*98.2%
metadata-eval98.2%
Simplified98.2%
Taylor expanded in z around 0 85.7%
metadata-eval85.7%
distribute-lft-neg-in85.7%
+-commutative85.7%
distribute-lft-neg-in85.7%
metadata-eval85.7%
associate-*r*85.7%
*-commutative85.7%
fma-udef85.7%
Simplified85.7%
Taylor expanded in a around inf 57.8%
if -5.60000000000000001e77 < (*.f64 a b) < -2.30000000000000001e-70 or -9.9999999999999993e-130 < (*.f64 a b) < -2.89999999999999977e-243Initial program 97.7%
Taylor expanded in c around inf 48.8%
if -2.30000000000000001e-70 < (*.f64 a b) < -9.9999999999999993e-130Initial program 99.9%
Taylor expanded in x around 0 72.3%
Taylor expanded in t around inf 57.6%
if -2.89999999999999977e-243 < (*.f64 a b) < 2.35e55Initial program 97.9%
associate-+l-97.9%
associate--l+97.9%
fma-def97.9%
associate-*l/98.9%
fma-neg98.9%
sub-neg98.9%
distribute-neg-in98.9%
remove-double-neg98.9%
associate-/l*98.9%
distribute-frac-neg98.9%
associate-/r/98.9%
fma-def98.9%
neg-mul-198.9%
*-commutative98.9%
associate-/l*98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 70.3%
metadata-eval70.3%
distribute-lft-neg-in70.3%
+-commutative70.3%
distribute-lft-neg-in70.3%
metadata-eval70.3%
associate-*r*70.3%
*-commutative70.3%
fma-udef70.3%
Simplified70.3%
Taylor expanded in x around inf 43.9%
Final simplification51.4%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* (* z t) 0.0625)))
(if (<= t -0.145)
t_2
(if (<= t -8e-287)
t_1
(if (<= t 2.9e-123)
(+ c (* b (* a -0.25)))
(if (<= t 1.35e+90)
t_1
(if (<= t 5.2e+250) (+ (* x y) t_2) (+ c (* t (* z 0.0625))))))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = (z * t) * 0.0625;
double tmp;
if (t <= -0.145) {
tmp = t_2;
} else if (t <= -8e-287) {
tmp = t_1;
} else if (t <= 2.9e-123) {
tmp = c + (b * (a * -0.25));
} else if (t <= 1.35e+90) {
tmp = t_1;
} else if (t <= 5.2e+250) {
tmp = (x * y) + t_2;
} else {
tmp = c + (t * (z * 0.0625));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = (z * t) * 0.0625d0
if (t <= (-0.145d0)) then
tmp = t_2
else if (t <= (-8d-287)) then
tmp = t_1
else if (t <= 2.9d-123) then
tmp = c + (b * (a * (-0.25d0)))
else if (t <= 1.35d+90) then
tmp = t_1
else if (t <= 5.2d+250) then
tmp = (x * y) + t_2
else
tmp = c + (t * (z * 0.0625d0))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = (z * t) * 0.0625;
double tmp;
if (t <= -0.145) {
tmp = t_2;
} else if (t <= -8e-287) {
tmp = t_1;
} else if (t <= 2.9e-123) {
tmp = c + (b * (a * -0.25));
} else if (t <= 1.35e+90) {
tmp = t_1;
} else if (t <= 5.2e+250) {
tmp = (x * y) + t_2;
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = (z * t) * 0.0625 tmp = 0 if t <= -0.145: tmp = t_2 elif t <= -8e-287: tmp = t_1 elif t <= 2.9e-123: tmp = c + (b * (a * -0.25)) elif t <= 1.35e+90: tmp = t_1 elif t <= 5.2e+250: tmp = (x * y) + t_2 else: tmp = c + (t * (z * 0.0625)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (t <= -0.145) tmp = t_2; elseif (t <= -8e-287) tmp = t_1; elseif (t <= 2.9e-123) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (t <= 1.35e+90) tmp = t_1; elseif (t <= 5.2e+250) tmp = Float64(Float64(x * y) + t_2); else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = c + (x * y);
t_2 = (z * t) * 0.0625;
tmp = 0.0;
if (t <= -0.145)
tmp = t_2;
elseif (t <= -8e-287)
tmp = t_1;
elseif (t <= 2.9e-123)
tmp = c + (b * (a * -0.25));
elseif (t <= 1.35e+90)
tmp = t_1;
elseif (t <= 5.2e+250)
tmp = (x * y) + t_2;
else
tmp = c + (t * (z * 0.0625));
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_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[t, -0.145], t$95$2, If[LessEqual[t, -8e-287], t$95$1, If[LessEqual[t, 2.9e-123], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+90], t$95$1, If[LessEqual[t, 5.2e+250], N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;t \leq -0.145:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-287}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-123}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+250}:\\
\;\;\;\;x \cdot y + t_2\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if t < -0.14499999999999999Initial program 96.7%
Taylor expanded in x around 0 80.9%
Taylor expanded in t around inf 55.3%
if -0.14499999999999999 < t < -8.00000000000000017e-287 or 2.90000000000000004e-123 < t < 1.35e90Initial program 99.0%
Taylor expanded in x around inf 60.1%
if -8.00000000000000017e-287 < t < 2.90000000000000004e-123Initial program 98.2%
Taylor expanded in a around inf 68.3%
associate-*r*68.3%
*-commutative68.3%
Simplified68.3%
if 1.35e90 < t < 5.20000000000000023e250Initial program 87.7%
associate-+l-87.7%
associate--l+87.7%
fma-def87.7%
associate-*l/91.3%
fma-neg95.7%
sub-neg95.7%
distribute-neg-in95.7%
remove-double-neg95.7%
associate-/l*95.7%
distribute-frac-neg95.7%
associate-/r/95.7%
fma-def95.7%
neg-mul-195.7%
*-commutative95.7%
associate-/l*95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in a around 0 75.5%
Taylor expanded in c around 0 71.0%
if 5.20000000000000023e250 < t Initial program 80.0%
Taylor expanded in z around inf 80.0%
*-commutative80.0%
associate-*r*80.0%
*-commutative80.0%
Simplified80.0%
Final simplification62.5%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e-40) (not (<= (* a b) 100000000.0))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* (* z t) 0.0625)))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e-40) || !((a * b) <= 100000000.0)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-1d-40)) .or. (.not. ((a * b) <= 100000000.0d0))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e-40) || !((a * b) <= 100000000.0)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1e-40) or not ((a * b) <= 100000000.0): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1e-40) || !(Float64(a * b) <= 100000000.0)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (((a * b) <= -1e-40) || ~(((a * b) <= 100000000.0)))
tmp = (c + (x * y)) - ((a * b) * 0.25);
else
tmp = c + ((x * y) + ((z * t) * 0.0625));
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_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e-40], N[Not[LessEqual[N[(a * b), $MachinePrecision], 100000000.0]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{-40} \lor \neg \left(a \cdot b \leq 100000000\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.9999999999999993e-41 or 1e8 < (*.f64 a b) Initial program 94.8%
Taylor expanded in z around 0 84.7%
if -9.9999999999999993e-41 < (*.f64 a b) < 1e8Initial program 98.4%
Taylor expanded in a around 0 97.6%
Final simplification90.8%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) -0.25)))
(if (<= (* a b) -9.5e+74)
t_1
(if (<= (* a b) -8.2e-253) c (if (<= (* a b) 5.2e+53) (* x y) t_1)))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -9.5e+74) {
tmp = t_1;
} else if ((a * b) <= -8.2e-253) {
tmp = c;
} else if ((a * b) <= 5.2e+53) {
tmp = x * y;
} else {
tmp = t_1;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) * (-0.25d0)
if ((a * b) <= (-9.5d+74)) then
tmp = t_1
else if ((a * b) <= (-8.2d-253)) then
tmp = c
else if ((a * b) <= 5.2d+53) then
tmp = x * y
else
tmp = t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -9.5e+74) {
tmp = t_1;
} else if ((a * b) <= -8.2e-253) {
tmp = c;
} else if ((a * b) <= 5.2e+53) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = (a * b) * -0.25 tmp = 0 if (a * b) <= -9.5e+74: tmp = t_1 elif (a * b) <= -8.2e-253: tmp = c elif (a * b) <= 5.2e+53: tmp = x * y else: tmp = t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(a * b) <= -9.5e+74) tmp = t_1; elseif (Float64(a * b) <= -8.2e-253) tmp = c; elseif (Float64(a * b) <= 5.2e+53) tmp = Float64(x * y); else tmp = t_1; end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (a * b) * -0.25;
tmp = 0.0;
if ((a * b) <= -9.5e+74)
tmp = t_1;
elseif ((a * b) <= -8.2e-253)
tmp = c;
elseif ((a * b) <= 5.2e+53)
tmp = x * y;
else
tmp = t_1;
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_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -9.5e+74], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -8.2e-253], c, If[LessEqual[N[(a * b), $MachinePrecision], 5.2e+53], N[(x * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -9.5 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-253}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{+53}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.5000000000000006e74 or 5.19999999999999996e53 < (*.f64 a b) Initial program 94.5%
associate-+l-94.5%
associate--l+94.5%
fma-def97.2%
associate-*l/97.2%
fma-neg98.2%
sub-neg98.2%
distribute-neg-in98.2%
remove-double-neg98.2%
associate-/l*98.1%
distribute-frac-neg98.1%
associate-/r/98.2%
fma-def98.2%
neg-mul-198.2%
*-commutative98.2%
associate-/l*98.2%
metadata-eval98.2%
Simplified98.2%
Taylor expanded in z around 0 85.7%
metadata-eval85.7%
distribute-lft-neg-in85.7%
+-commutative85.7%
distribute-lft-neg-in85.7%
metadata-eval85.7%
associate-*r*85.7%
*-commutative85.7%
fma-udef85.7%
Simplified85.7%
Taylor expanded in a around inf 57.8%
if -9.5000000000000006e74 < (*.f64 a b) < -8.20000000000000004e-253Initial program 98.2%
Taylor expanded in c around inf 41.0%
if -8.20000000000000004e-253 < (*.f64 a b) < 5.19999999999999996e53Initial program 97.9%
associate-+l-97.9%
associate--l+97.9%
fma-def97.9%
associate-*l/98.9%
fma-neg98.9%
sub-neg98.9%
distribute-neg-in98.9%
remove-double-neg98.9%
associate-/l*98.9%
distribute-frac-neg98.9%
associate-/r/98.9%
fma-def98.9%
neg-mul-198.9%
*-commutative98.9%
associate-/l*98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 70.3%
metadata-eval70.3%
distribute-lft-neg-in70.3%
+-commutative70.3%
distribute-lft-neg-in70.3%
metadata-eval70.3%
associate-*r*70.3%
*-commutative70.3%
fma-udef70.3%
Simplified70.3%
Taylor expanded in x around inf 43.9%
Final simplification49.2%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (or (<= x -4.3e+48) (not (<= x 2.45e-95)))
(- (+ c (* x y)) t_1)
(- (+ c (* (* z t) 0.0625)) t_1))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double tmp;
if ((x <= -4.3e+48) || !(x <= 2.45e-95)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - t_1;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) * 0.25d0
if ((x <= (-4.3d+48)) .or. (.not. (x <= 2.45d-95))) then
tmp = (c + (x * y)) - t_1
else
tmp = (c + ((z * t) * 0.0625d0)) - t_1
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double tmp;
if ((x <= -4.3e+48) || !(x <= 2.45e-95)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + ((z * t) * 0.0625)) - t_1;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if (x <= -4.3e+48) or not (x <= 2.45e-95): tmp = (c + (x * y)) - t_1 else: tmp = (c + ((z * t) * 0.0625)) - t_1 return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if ((x <= -4.3e+48) || !(x <= 2.45e-95)) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(c + Float64(Float64(z * t) * 0.0625)) - t_1); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (a * b) * 0.25;
tmp = 0.0;
if ((x <= -4.3e+48) || ~((x <= 2.45e-95)))
tmp = (c + (x * y)) - t_1;
else
tmp = (c + ((z * t) * 0.0625)) - t_1;
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_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[Or[LessEqual[x, -4.3e+48], N[Not[LessEqual[x, 2.45e-95]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{+48} \lor \neg \left(x \leq 2.45 \cdot 10^{-95}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + \left(z \cdot t\right) \cdot 0.0625\right) - t_1\\
\end{array}
\end{array}
if x < -4.29999999999999978e48 or 2.45e-95 < x Initial program 94.9%
Taylor expanded in z around 0 83.6%
if -4.29999999999999978e48 < x < 2.45e-95Initial program 98.4%
Taylor expanded in x around 0 93.7%
Final simplification88.3%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0));
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = c + ((((z * t) / 16.0d0) + (x * y)) - ((a * b) / 4.0d0))
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0));
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): return c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0))
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0))) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0));
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
c + \left(\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 96.5%
Final simplification96.5%
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= t -0.14)
(* (* z t) 0.0625)
(if (<= t -9.5e-287)
t_1
(if (<= t 1.08e-122)
(+ c (* b (* a -0.25)))
(if (<= t 6e+83) t_1 (+ c (* t (* z 0.0625)))))))))assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if (t <= -0.14) {
tmp = (z * t) * 0.0625;
} else if (t <= -9.5e-287) {
tmp = t_1;
} else if (t <= 1.08e-122) {
tmp = c + (b * (a * -0.25));
} else if (t <= 6e+83) {
tmp = t_1;
} else {
tmp = c + (t * (z * 0.0625));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if (t <= (-0.14d0)) then
tmp = (z * t) * 0.0625d0
else if (t <= (-9.5d-287)) then
tmp = t_1
else if (t <= 1.08d-122) then
tmp = c + (b * (a * (-0.25d0)))
else if (t <= 6d+83) then
tmp = t_1
else
tmp = c + (t * (z * 0.0625d0))
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if (t <= -0.14) {
tmp = (z * t) * 0.0625;
} else if (t <= -9.5e-287) {
tmp = t_1;
} else if (t <= 1.08e-122) {
tmp = c + (b * (a * -0.25));
} else if (t <= 6e+83) {
tmp = t_1;
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if t <= -0.14: tmp = (z * t) * 0.0625 elif t <= -9.5e-287: tmp = t_1 elif t <= 1.08e-122: tmp = c + (b * (a * -0.25)) elif t <= 6e+83: tmp = t_1 else: tmp = c + (t * (z * 0.0625)) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (t <= -0.14) tmp = Float64(Float64(z * t) * 0.0625); elseif (t <= -9.5e-287) tmp = t_1; elseif (t <= 1.08e-122) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (t <= 6e+83) tmp = t_1; else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = c + (x * y);
tmp = 0.0;
if (t <= -0.14)
tmp = (z * t) * 0.0625;
elseif (t <= -9.5e-287)
tmp = t_1;
elseif (t <= 1.08e-122)
tmp = c + (b * (a * -0.25));
elseif (t <= 6e+83)
tmp = t_1;
else
tmp = c + (t * (z * 0.0625));
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_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.14], N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[t, -9.5e-287], t$95$1, If[LessEqual[t, 1.08e-122], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+83], t$95$1, N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;t \leq -0.14:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-287}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.08 \cdot 10^{-122}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if t < -0.14000000000000001Initial program 96.7%
Taylor expanded in x around 0 80.9%
Taylor expanded in t around inf 55.3%
if -0.14000000000000001 < t < -9.5000000000000004e-287 or 1.08e-122 < t < 5.9999999999999999e83Initial program 99.0%
Taylor expanded in x around inf 59.7%
if -9.5000000000000004e-287 < t < 1.08e-122Initial program 98.2%
Taylor expanded in a around inf 68.3%
associate-*r*68.3%
*-commutative68.3%
Simplified68.3%
if 5.9999999999999999e83 < t Initial program 85.8%
Taylor expanded in z around inf 66.1%
*-commutative66.1%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
Final simplification61.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1.46e+181) (not (<= (* a b) 2.9e+138))) (* (* a b) -0.25) (+ c (* x y))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1.46e+181) || !((a * b) <= 2.9e+138)) {
tmp = (a * b) * -0.25;
} else {
tmp = c + (x * y);
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-1.46d+181)) .or. (.not. ((a * b) <= 2.9d+138))) then
tmp = (a * b) * (-0.25d0)
else
tmp = c + (x * y)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1.46e+181) || !((a * b) <= 2.9e+138)) {
tmp = (a * b) * -0.25;
} else {
tmp = c + (x * y);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1.46e+181) or not ((a * b) <= 2.9e+138): tmp = (a * b) * -0.25 else: tmp = c + (x * y) return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1.46e+181) || !(Float64(a * b) <= 2.9e+138)) tmp = Float64(Float64(a * b) * -0.25); else tmp = Float64(c + Float64(x * y)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (((a * b) <= -1.46e+181) || ~(((a * b) <= 2.9e+138)))
tmp = (a * b) * -0.25;
else
tmp = c + (x * y);
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_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.46e+181], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.9e+138]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.46 \cdot 10^{+181} \lor \neg \left(a \cdot b \leq 2.9 \cdot 10^{+138}\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -1.46000000000000008e181 or 2.9000000000000001e138 < (*.f64 a b) Initial program 90.6%
associate-+l-90.6%
associate--l+90.6%
fma-def95.3%
associate-*l/95.3%
fma-neg96.9%
sub-neg96.9%
distribute-neg-in96.9%
remove-double-neg96.9%
associate-/l*96.8%
distribute-frac-neg96.8%
associate-/r/96.9%
fma-def96.9%
neg-mul-196.9%
*-commutative96.9%
associate-/l*96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in z around 0 86.1%
metadata-eval86.1%
distribute-lft-neg-in86.1%
+-commutative86.1%
distribute-lft-neg-in86.1%
metadata-eval86.1%
associate-*r*86.1%
*-commutative86.1%
fma-udef86.1%
Simplified86.1%
Taylor expanded in a around inf 75.2%
if -1.46000000000000008e181 < (*.f64 a b) < 2.9000000000000001e138Initial program 98.5%
Taylor expanded in x around inf 63.2%
Final simplification66.2%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= x -4.6e+45) (* x y) (if (<= x 2.8e-34) c (* x y))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -4.6e+45) {
tmp = x * y;
} else if (x <= 2.8e-34) {
tmp = c;
} else {
tmp = x * y;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (x <= (-4.6d+45)) then
tmp = x * y
else if (x <= 2.8d-34) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -4.6e+45) {
tmp = x * y;
} else if (x <= 2.8e-34) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): tmp = 0 if x <= -4.6e+45: tmp = x * y elif x <= 2.8e-34: tmp = c else: tmp = x * y return tmp
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -4.6e+45) tmp = Float64(x * y); elseif (x <= 2.8e-34) tmp = c; else tmp = Float64(x * y); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (x <= -4.6e+45)
tmp = x * y;
elseif (x <= 2.8e-34)
tmp = c;
else
tmp = x * y;
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_, b_, c_] := If[LessEqual[x, -4.6e+45], N[(x * y), $MachinePrecision], If[LessEqual[x, 2.8e-34], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+45}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-34}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -4.60000000000000025e45 or 2.79999999999999997e-34 < x Initial program 94.4%
associate-+l-94.4%
associate--l+94.4%
fma-def96.8%
associate-*l/96.8%
fma-neg96.8%
sub-neg96.8%
distribute-neg-in96.8%
remove-double-neg96.8%
associate-/l*96.8%
distribute-frac-neg96.8%
associate-/r/96.8%
fma-def96.8%
neg-mul-196.8%
*-commutative96.8%
associate-/l*96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in z around 0 84.4%
metadata-eval84.4%
distribute-lft-neg-in84.4%
+-commutative84.4%
distribute-lft-neg-in84.4%
metadata-eval84.4%
associate-*r*84.4%
*-commutative84.4%
fma-udef84.4%
Simplified84.4%
Taylor expanded in x around inf 48.5%
if -4.60000000000000025e45 < x < 2.79999999999999997e-34Initial program 98.6%
Taylor expanded in c around inf 31.0%
Final simplification39.5%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 c)
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
[z, t] = sort([z, t]) def code(x, y, z, t, a, b, c): return c
z, t = sort([z, t]) function code(x, y, z, t, a, b, c) return c end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = c;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
c
\end{array}
Initial program 96.5%
Taylor expanded in c around inf 23.7%
Final simplification23.7%
herbie shell --seed 2023268
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))