
(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}
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (/ (* t z) 16.0) (* x y))))
(if (<= t_1 5e+300)
(+ c (- t_1 (/ (* b a) 4.0)))
(fma t (/ z 16.0) (+ c (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((t * z) / 16.0) + (x * y);
double tmp;
if (t_1 <= 5e+300) {
tmp = c + (t_1 - ((b * a) / 4.0));
} else {
tmp = fma(t, (z / 16.0), (c + (x * y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) tmp = 0.0 if (t_1 <= 5e+300) tmp = Float64(c + Float64(t_1 - Float64(Float64(b * a) / 4.0))); else tmp = fma(t, Float64(z / 16.0), Float64(c + Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+300], N[(c + N[(t$95$1 - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / 16.0), $MachinePrecision] + N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot z}{16} + x \cdot y\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c + \left(t_1 - \frac{b \cdot a}{4}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{z}{16}, c + x \cdot y\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) < 5.00000000000000026e300Initial program 100.0%
if 5.00000000000000026e300 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) Initial program 75.8%
associate-+l-75.8%
+-commutative75.8%
associate--l+75.8%
associate-*l/75.8%
*-commutative75.8%
fma-def87.9%
fma-neg87.9%
neg-sub087.9%
associate-+l-87.9%
neg-sub087.9%
+-commutative87.9%
unsub-neg87.9%
*-commutative87.9%
associate-*r/87.9%
Simplified87.9%
Taylor expanded in b around 0 90.9%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (fma t (/ z 16.0) (fma x y (- c (* b (/ a 4.0))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(t, (z / 16.0), fma(x, y, (c - (b * (a / 4.0)))));
}
function code(x, y, z, t, a, b, c) return fma(t, Float64(z / 16.0), fma(x, y, Float64(c - Float64(b * Float64(a / 4.0))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(t * N[(z / 16.0), $MachinePrecision] + N[(x * y + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Initial program 96.9%
associate-+l-96.9%
+-commutative96.9%
associate--l+96.9%
associate-*l/96.9%
*-commutative96.9%
fma-def98.4%
fma-neg98.4%
neg-sub098.4%
associate-+l-98.4%
neg-sub098.4%
+-commutative98.4%
unsub-neg98.4%
*-commutative98.4%
associate-*r/98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (/ z (/ 16.0 t))) (- c (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, (z / (16.0 / t))) + (c - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(z / Float64(16.0 / t))) + Float64(c - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 96.9%
associate-+l-96.9%
sub-neg96.9%
neg-mul-196.9%
metadata-eval96.9%
metadata-eval96.9%
cancel-sign-sub-inv96.9%
fma-def98.0%
associate-/l*98.0%
metadata-eval98.0%
*-lft-identity98.0%
associate-/l*97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in a around 0 12.5%
Taylor expanded in t around 0 62.5%
Final simplification98.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y)))
(t_2 (+ c (* (* t z) 0.0625)))
(t_3 (+ c (* (* b a) -0.25))))
(if (<= (* b a) -5e+145)
t_3
(if (<= (* b a) -2e-57)
t_1
(if (<= (* b a) -2e-120)
t_2
(if (<= (* b a) 2e-291)
t_1
(if (<= (* b a) 2e-106) t_2 (if (<= (* b a) 1.0) t_1 t_3))))))))
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 = c + ((t * z) * 0.0625);
double t_3 = c + ((b * a) * -0.25);
double tmp;
if ((b * a) <= -5e+145) {
tmp = t_3;
} else if ((b * a) <= -2e-57) {
tmp = t_1;
} else if ((b * a) <= -2e-120) {
tmp = t_2;
} else if ((b * a) <= 2e-291) {
tmp = t_1;
} else if ((b * a) <= 2e-106) {
tmp = t_2;
} else if ((b * a) <= 1.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
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) :: t_3
real(8) :: tmp
t_1 = c + (x * y)
t_2 = c + ((t * z) * 0.0625d0)
t_3 = c + ((b * a) * (-0.25d0))
if ((b * a) <= (-5d+145)) then
tmp = t_3
else if ((b * a) <= (-2d-57)) then
tmp = t_1
else if ((b * a) <= (-2d-120)) then
tmp = t_2
else if ((b * a) <= 2d-291) then
tmp = t_1
else if ((b * a) <= 2d-106) then
tmp = t_2
else if ((b * a) <= 1.0d0) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
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 = c + ((t * z) * 0.0625);
double t_3 = c + ((b * a) * -0.25);
double tmp;
if ((b * a) <= -5e+145) {
tmp = t_3;
} else if ((b * a) <= -2e-57) {
tmp = t_1;
} else if ((b * a) <= -2e-120) {
tmp = t_2;
} else if ((b * a) <= 2e-291) {
tmp = t_1;
} else if ((b * a) <= 2e-106) {
tmp = t_2;
} else if ((b * a) <= 1.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = c + ((t * z) * 0.0625) t_3 = c + ((b * a) * -0.25) tmp = 0 if (b * a) <= -5e+145: tmp = t_3 elif (b * a) <= -2e-57: tmp = t_1 elif (b * a) <= -2e-120: tmp = t_2 elif (b * a) <= 2e-291: tmp = t_1 elif (b * a) <= 2e-106: tmp = t_2 elif (b * a) <= 1.0: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(c + Float64(Float64(t * z) * 0.0625)) t_3 = Float64(c + Float64(Float64(b * a) * -0.25)) tmp = 0.0 if (Float64(b * a) <= -5e+145) tmp = t_3; elseif (Float64(b * a) <= -2e-57) tmp = t_1; elseif (Float64(b * a) <= -2e-120) tmp = t_2; elseif (Float64(b * a) <= 2e-291) tmp = t_1; elseif (Float64(b * a) <= 2e-106) tmp = t_2; elseif (Float64(b * a) <= 1.0) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = c + ((t * z) * 0.0625); t_3 = c + ((b * a) * -0.25); tmp = 0.0; if ((b * a) <= -5e+145) tmp = t_3; elseif ((b * a) <= -2e-57) tmp = t_1; elseif ((b * a) <= -2e-120) tmp = t_2; elseif ((b * a) <= 2e-291) tmp = t_1; elseif ((b * a) <= 2e-106) tmp = t_2; elseif ((b * a) <= 1.0) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5e+145], t$95$3, If[LessEqual[N[(b * a), $MachinePrecision], -2e-57], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -2e-120], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 2e-291], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 2e-106], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], 1.0], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + \left(t \cdot z\right) \cdot 0.0625\\
t_3 := c + \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+145}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-120}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-291}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-106}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq 1:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999967e145 or 1 < (*.f64 a b) Initial program 95.9%
Taylor expanded in a around inf 78.8%
*-commutative78.8%
Simplified78.8%
if -4.99999999999999967e145 < (*.f64 a b) < -1.99999999999999991e-57 or -1.99999999999999996e-120 < (*.f64 a b) < 1.99999999999999992e-291 or 1.99999999999999988e-106 < (*.f64 a b) < 1Initial program 97.5%
Taylor expanded in a around 0 92.1%
Taylor expanded in t around 0 73.0%
if -1.99999999999999991e-57 < (*.f64 a b) < -1.99999999999999996e-120 or 1.99999999999999992e-291 < (*.f64 a b) < 1.99999999999999988e-106Initial program 97.2%
Taylor expanded in a around 0 92.0%
Taylor expanded in y around 0 76.2%
Final simplification75.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* t z) 0.0625)))
(if (or (<= (* b a) -5e+145) (not (<= (* b a) 1.0)))
(+ t_1 (- c (/ a (/ 4.0 b))))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * z) * 0.0625;
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 1.0)) {
tmp = t_1 + (c - (a / (4.0 / b)));
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
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 = (t * z) * 0.0625d0
if (((b * a) <= (-5d+145)) .or. (.not. ((b * a) <= 1.0d0))) then
tmp = t_1 + (c - (a / (4.0d0 / b)))
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * z) * 0.0625;
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 1.0)) {
tmp = t_1 + (c - (a / (4.0 / b)));
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (t * z) * 0.0625 tmp = 0 if ((b * a) <= -5e+145) or not ((b * a) <= 1.0): tmp = t_1 + (c - (a / (4.0 / b))) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(t * z) * 0.0625) tmp = 0.0 if ((Float64(b * a) <= -5e+145) || !(Float64(b * a) <= 1.0)) tmp = Float64(t_1 + Float64(c - Float64(a / Float64(4.0 / b)))); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (t * z) * 0.0625; tmp = 0.0; if (((b * a) <= -5e+145) || ~(((b * a) <= 1.0))) tmp = t_1 + (c - (a / (4.0 / b))); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[Or[LessEqual[N[(b * a), $MachinePrecision], -5e+145], N[Not[LessEqual[N[(b * a), $MachinePrecision], 1.0]], $MachinePrecision]], N[(t$95$1 + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+145} \lor \neg \left(b \cdot a \leq 1\right):\\
\;\;\;\;t_1 + \left(c - \frac{a}{\frac{4}{b}}\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999967e145 or 1 < (*.f64 a b) Initial program 95.9%
associate-+l-95.9%
sub-neg95.9%
neg-mul-195.9%
metadata-eval95.9%
metadata-eval95.9%
cancel-sign-sub-inv95.9%
fma-def97.9%
associate-/l*97.9%
metadata-eval97.9%
*-lft-identity97.9%
associate-/l*97.7%
Simplified97.7%
fma-udef95.7%
associate-/l*95.7%
+-commutative95.7%
div-inv95.7%
metadata-eval95.7%
Applied egg-rr95.7%
Taylor expanded in z around inf 93.1%
if -4.99999999999999967e145 < (*.f64 a b) < 1Initial program 97.5%
Taylor expanded in a around 0 92.1%
Final simplification92.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* t z) 0.0625)))
(if (or (<= (* b a) -5e+145) (not (<= (* b a) 1.0)))
(- (+ c t_1) (* (* b a) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * z) * 0.0625;
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 1.0)) {
tmp = (c + t_1) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
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 = (t * z) * 0.0625d0
if (((b * a) <= (-5d+145)) .or. (.not. ((b * a) <= 1.0d0))) then
tmp = (c + t_1) - ((b * a) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * z) * 0.0625;
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 1.0)) {
tmp = (c + t_1) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (t * z) * 0.0625 tmp = 0 if ((b * a) <= -5e+145) or not ((b * a) <= 1.0): tmp = (c + t_1) - ((b * a) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(t * z) * 0.0625) tmp = 0.0 if ((Float64(b * a) <= -5e+145) || !(Float64(b * a) <= 1.0)) tmp = Float64(Float64(c + t_1) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (t * z) * 0.0625; tmp = 0.0; if (((b * a) <= -5e+145) || ~(((b * a) <= 1.0))) tmp = (c + t_1) - ((b * a) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[Or[LessEqual[N[(b * a), $MachinePrecision], -5e+145], N[Not[LessEqual[N[(b * a), $MachinePrecision], 1.0]], $MachinePrecision]], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+145} \lor \neg \left(b \cdot a \leq 1\right):\\
\;\;\;\;\left(c + t_1\right) - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999967e145 or 1 < (*.f64 a b) Initial program 95.9%
Taylor expanded in x around 0 93.2%
if -4.99999999999999967e145 < (*.f64 a b) < 1Initial program 97.5%
Taylor expanded in a around 0 92.1%
Final simplification92.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -5e+145) (not (<= (* b a) 2e+66))) (+ c (* (* b a) -0.25)) (+ c (+ (* x y) (* (* t z) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 2e+66)) {
tmp = c + ((b * a) * -0.25);
} else {
tmp = c + ((x * y) + ((t * z) * 0.0625));
}
return tmp;
}
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 (((b * a) <= (-5d+145)) .or. (.not. ((b * a) <= 2d+66))) then
tmp = c + ((b * a) * (-0.25d0))
else
tmp = c + ((x * y) + ((t * z) * 0.0625d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 2e+66)) {
tmp = c + ((b * a) * -0.25);
} else {
tmp = c + ((x * y) + ((t * z) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -5e+145) or not ((b * a) <= 2e+66): tmp = c + ((b * a) * -0.25) else: tmp = c + ((x * y) + ((t * z) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -5e+145) || !(Float64(b * a) <= 2e+66)) tmp = Float64(c + Float64(Float64(b * a) * -0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(t * z) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -5e+145) || ~(((b * a) <= 2e+66))) tmp = c + ((b * a) * -0.25); else tmp = c + ((x * y) + ((t * z) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -5e+145], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+66]], $MachinePrecision]], N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+145} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+66}\right):\\
\;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(t \cdot z\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999967e145 or 1.99999999999999989e66 < (*.f64 a b) Initial program 95.2%
Taylor expanded in a around inf 81.3%
*-commutative81.3%
Simplified81.3%
if -4.99999999999999967e145 < (*.f64 a b) < 1.99999999999999989e66Initial program 97.7%
Taylor expanded in a around 0 90.4%
Final simplification87.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* t z) 0.0625)))
(if (or (<= (* b a) -5e+145) (not (<= (* b a) 2e+66)))
(- t_1 (* (* b a) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * z) * 0.0625;
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 2e+66)) {
tmp = t_1 - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
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 = (t * z) * 0.0625d0
if (((b * a) <= (-5d+145)) .or. (.not. ((b * a) <= 2d+66))) then
tmp = t_1 - ((b * a) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (t * z) * 0.0625;
double tmp;
if (((b * a) <= -5e+145) || !((b * a) <= 2e+66)) {
tmp = t_1 - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (t * z) * 0.0625 tmp = 0 if ((b * a) <= -5e+145) or not ((b * a) <= 2e+66): tmp = t_1 - ((b * a) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(t * z) * 0.0625) tmp = 0.0 if ((Float64(b * a) <= -5e+145) || !(Float64(b * a) <= 2e+66)) tmp = Float64(t_1 - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (t * z) * 0.0625; tmp = 0.0; if (((b * a) <= -5e+145) || ~(((b * a) <= 2e+66))) tmp = t_1 - ((b * a) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[Or[LessEqual[N[(b * a), $MachinePrecision], -5e+145], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+66]], $MachinePrecision]], N[(t$95$1 - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+145} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+66}\right):\\
\;\;\;\;t_1 - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999967e145 or 1.99999999999999989e66 < (*.f64 a b) Initial program 95.2%
Taylor expanded in x around 0 94.5%
Taylor expanded in c around 0 84.2%
if -4.99999999999999967e145 < (*.f64 a b) < 1.99999999999999989e66Initial program 97.7%
Taylor expanded in a around 0 90.4%
Final simplification88.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -1.5e+91) (not (<= (* b a) 5e-37))) (- (+ c (* x y)) (* (* b a) 0.25)) (+ c (+ (* x y) (* (* t z) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -1.5e+91) || !((b * a) <= 5e-37)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + ((t * z) * 0.0625));
}
return tmp;
}
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 (((b * a) <= (-1.5d+91)) .or. (.not. ((b * a) <= 5d-37))) then
tmp = (c + (x * y)) - ((b * a) * 0.25d0)
else
tmp = c + ((x * y) + ((t * z) * 0.0625d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -1.5e+91) || !((b * a) <= 5e-37)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((x * y) + ((t * z) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -1.5e+91) or not ((b * a) <= 5e-37): tmp = (c + (x * y)) - ((b * a) * 0.25) else: tmp = c + ((x * y) + ((t * z) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -1.5e+91) || !(Float64(b * a) <= 5e-37)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(t * z) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -1.5e+91) || ~(((b * a) <= 5e-37))) tmp = (c + (x * y)) - ((b * a) * 0.25); else tmp = c + ((x * y) + ((t * z) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -1.5e+91], N[Not[LessEqual[N[(b * a), $MachinePrecision], 5e-37]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1.5 \cdot 10^{+91} \lor \neg \left(b \cdot a \leq 5 \cdot 10^{-37}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(t \cdot z\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.50000000000000003e91 or 4.9999999999999997e-37 < (*.f64 a b) Initial program 95.5%
Taylor expanded in z around 0 83.9%
if -1.50000000000000003e91 < (*.f64 a b) < 4.9999999999999997e-37Initial program 97.9%
Taylor expanded in a around 0 93.4%
Final simplification89.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= y -2.9e+31)
(* x y)
(if (<= y 5.2e-267)
t_1
(if (<= y 2.4e-214)
c
(if (<= y 1.05e-101)
t_1
(if (<= y 4.8e-47)
(* (* t z) 0.0625)
(if (<= y 3600000.0) t_1 (if (<= y 9.5e+70) c (* x y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double tmp;
if (y <= -2.9e+31) {
tmp = x * y;
} else if (y <= 5.2e-267) {
tmp = t_1;
} else if (y <= 2.4e-214) {
tmp = c;
} else if (y <= 1.05e-101) {
tmp = t_1;
} else if (y <= 4.8e-47) {
tmp = (t * z) * 0.0625;
} else if (y <= 3600000.0) {
tmp = t_1;
} else if (y <= 9.5e+70) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
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 = b * (a * (-0.25d0))
if (y <= (-2.9d+31)) then
tmp = x * y
else if (y <= 5.2d-267) then
tmp = t_1
else if (y <= 2.4d-214) then
tmp = c
else if (y <= 1.05d-101) then
tmp = t_1
else if (y <= 4.8d-47) then
tmp = (t * z) * 0.0625d0
else if (y <= 3600000.0d0) then
tmp = t_1
else if (y <= 9.5d+70) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double tmp;
if (y <= -2.9e+31) {
tmp = x * y;
} else if (y <= 5.2e-267) {
tmp = t_1;
} else if (y <= 2.4e-214) {
tmp = c;
} else if (y <= 1.05e-101) {
tmp = t_1;
} else if (y <= 4.8e-47) {
tmp = (t * z) * 0.0625;
} else if (y <= 3600000.0) {
tmp = t_1;
} else if (y <= 9.5e+70) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) tmp = 0 if y <= -2.9e+31: tmp = x * y elif y <= 5.2e-267: tmp = t_1 elif y <= 2.4e-214: tmp = c elif y <= 1.05e-101: tmp = t_1 elif y <= 4.8e-47: tmp = (t * z) * 0.0625 elif y <= 3600000.0: tmp = t_1 elif y <= 9.5e+70: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (y <= -2.9e+31) tmp = Float64(x * y); elseif (y <= 5.2e-267) tmp = t_1; elseif (y <= 2.4e-214) tmp = c; elseif (y <= 1.05e-101) tmp = t_1; elseif (y <= 4.8e-47) tmp = Float64(Float64(t * z) * 0.0625); elseif (y <= 3600000.0) tmp = t_1; elseif (y <= 9.5e+70) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b * (a * -0.25); tmp = 0.0; if (y <= -2.9e+31) tmp = x * y; elseif (y <= 5.2e-267) tmp = t_1; elseif (y <= 2.4e-214) tmp = c; elseif (y <= 1.05e-101) tmp = t_1; elseif (y <= 4.8e-47) tmp = (t * z) * 0.0625; elseif (y <= 3600000.0) tmp = t_1; elseif (y <= 9.5e+70) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+31], N[(x * y), $MachinePrecision], If[LessEqual[y, 5.2e-267], t$95$1, If[LessEqual[y, 2.4e-214], c, If[LessEqual[y, 1.05e-101], t$95$1, If[LessEqual[y, 4.8e-47], N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[y, 3600000.0], t$95$1, If[LessEqual[y, 9.5e+70], c, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+31}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-267}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-214}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-47}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\
\mathbf{elif}\;y \leq 3600000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.9e31 or 9.5000000000000002e70 < y Initial program 92.9%
Taylor expanded in z around 0 85.7%
Taylor expanded in c around 0 70.4%
Taylor expanded in y around inf 52.4%
if -2.9e31 < y < 5.2000000000000003e-267 or 2.4000000000000002e-214 < y < 1.05000000000000008e-101 or 4.7999999999999999e-47 < y < 3.6e6Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.9%
metadata-eval99.9%
*-lft-identity99.9%
associate-/l*99.8%
Simplified99.8%
fma-udef99.8%
associate-/l*99.9%
+-commutative99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 40.5%
associate-*r*40.5%
Simplified40.5%
if 5.2000000000000003e-267 < y < 2.4000000000000002e-214 or 3.6e6 < y < 9.5000000000000002e70Initial program 99.9%
Taylor expanded in c around inf 39.2%
if 1.05000000000000008e-101 < y < 4.7999999999999999e-47Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*100.0%
metadata-eval100.0%
*-lft-identity100.0%
associate-/l*99.8%
Simplified99.8%
fma-udef99.8%
associate-/l*99.8%
+-commutative99.8%
div-inv99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in t around inf 51.0%
Final simplification45.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y)))
(t_2 (+ c (* (* t z) 0.0625)))
(t_3 (* b (* a -0.25))))
(if (<= b -1.25e-52)
t_3
(if (<= b 7.9e-221)
t_1
(if (<= b 1.3e-145)
t_2
(if (<= b 8e-76)
t_1
(if (<= b 2.5e-9) t_2 (if (<= b 1.5e+206) t_1 t_3))))))))
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 = c + ((t * z) * 0.0625);
double t_3 = b * (a * -0.25);
double tmp;
if (b <= -1.25e-52) {
tmp = t_3;
} else if (b <= 7.9e-221) {
tmp = t_1;
} else if (b <= 1.3e-145) {
tmp = t_2;
} else if (b <= 8e-76) {
tmp = t_1;
} else if (b <= 2.5e-9) {
tmp = t_2;
} else if (b <= 1.5e+206) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
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) :: t_3
real(8) :: tmp
t_1 = c + (x * y)
t_2 = c + ((t * z) * 0.0625d0)
t_3 = b * (a * (-0.25d0))
if (b <= (-1.25d-52)) then
tmp = t_3
else if (b <= 7.9d-221) then
tmp = t_1
else if (b <= 1.3d-145) then
tmp = t_2
else if (b <= 8d-76) then
tmp = t_1
else if (b <= 2.5d-9) then
tmp = t_2
else if (b <= 1.5d+206) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
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 = c + ((t * z) * 0.0625);
double t_3 = b * (a * -0.25);
double tmp;
if (b <= -1.25e-52) {
tmp = t_3;
} else if (b <= 7.9e-221) {
tmp = t_1;
} else if (b <= 1.3e-145) {
tmp = t_2;
} else if (b <= 8e-76) {
tmp = t_1;
} else if (b <= 2.5e-9) {
tmp = t_2;
} else if (b <= 1.5e+206) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = c + ((t * z) * 0.0625) t_3 = b * (a * -0.25) tmp = 0 if b <= -1.25e-52: tmp = t_3 elif b <= 7.9e-221: tmp = t_1 elif b <= 1.3e-145: tmp = t_2 elif b <= 8e-76: tmp = t_1 elif b <= 2.5e-9: tmp = t_2 elif b <= 1.5e+206: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(c + Float64(Float64(t * z) * 0.0625)) t_3 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (b <= -1.25e-52) tmp = t_3; elseif (b <= 7.9e-221) tmp = t_1; elseif (b <= 1.3e-145) tmp = t_2; elseif (b <= 8e-76) tmp = t_1; elseif (b <= 2.5e-9) tmp = t_2; elseif (b <= 1.5e+206) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = c + ((t * z) * 0.0625); t_3 = b * (a * -0.25); tmp = 0.0; if (b <= -1.25e-52) tmp = t_3; elseif (b <= 7.9e-221) tmp = t_1; elseif (b <= 1.3e-145) tmp = t_2; elseif (b <= 8e-76) tmp = t_1; elseif (b <= 2.5e-9) tmp = t_2; elseif (b <= 1.5e+206) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.25e-52], t$95$3, If[LessEqual[b, 7.9e-221], t$95$1, If[LessEqual[b, 1.3e-145], t$95$2, If[LessEqual[b, 8e-76], t$95$1, If[LessEqual[b, 2.5e-9], t$95$2, If[LessEqual[b, 1.5e+206], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + \left(t \cdot z\right) \cdot 0.0625\\
t_3 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{-52}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \leq 7.9 \cdot 10^{-221}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-145}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 8 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-9}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if b < -1.25e-52 or 1.5000000000000001e206 < b Initial program 95.8%
associate-+l-95.8%
sub-neg95.8%
neg-mul-195.8%
metadata-eval95.8%
metadata-eval95.8%
cancel-sign-sub-inv95.8%
fma-def97.9%
associate-/l*97.9%
metadata-eval97.9%
*-lft-identity97.9%
associate-/l*97.8%
Simplified97.8%
fma-udef95.7%
associate-/l*95.7%
+-commutative95.7%
div-inv95.7%
metadata-eval95.7%
Applied egg-rr95.7%
Taylor expanded in a around inf 51.7%
associate-*r*51.7%
Simplified51.7%
if -1.25e-52 < b < 7.9000000000000004e-221 or 1.3e-145 < b < 7.99999999999999942e-76 or 2.5000000000000001e-9 < b < 1.5000000000000001e206Initial program 97.6%
Taylor expanded in a around 0 83.3%
Taylor expanded in t around 0 66.7%
if 7.9000000000000004e-221 < b < 1.3e-145 or 7.99999999999999942e-76 < b < 2.5000000000000001e-9Initial program 97.0%
Taylor expanded in a around 0 85.3%
Taylor expanded in y around 0 61.8%
Final simplification60.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* b (* a -0.25))))
(if (<= b -1.25e-52)
t_2
(if (<= b 1.16e-200)
t_1
(if (<= b 1.2e-147) (* (* t z) 0.0625) (if (<= b 1.5e+206) t_1 t_2))))))
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 = b * (a * -0.25);
double tmp;
if (b <= -1.25e-52) {
tmp = t_2;
} else if (b <= 1.16e-200) {
tmp = t_1;
} else if (b <= 1.2e-147) {
tmp = (t * z) * 0.0625;
} else if (b <= 1.5e+206) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
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 = b * (a * (-0.25d0))
if (b <= (-1.25d-52)) then
tmp = t_2
else if (b <= 1.16d-200) then
tmp = t_1
else if (b <= 1.2d-147) then
tmp = (t * z) * 0.0625d0
else if (b <= 1.5d+206) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
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 = b * (a * -0.25);
double tmp;
if (b <= -1.25e-52) {
tmp = t_2;
} else if (b <= 1.16e-200) {
tmp = t_1;
} else if (b <= 1.2e-147) {
tmp = (t * z) * 0.0625;
} else if (b <= 1.5e+206) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = b * (a * -0.25) tmp = 0 if b <= -1.25e-52: tmp = t_2 elif b <= 1.16e-200: tmp = t_1 elif b <= 1.2e-147: tmp = (t * z) * 0.0625 elif b <= 1.5e+206: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (b <= -1.25e-52) tmp = t_2; elseif (b <= 1.16e-200) tmp = t_1; elseif (b <= 1.2e-147) tmp = Float64(Float64(t * z) * 0.0625); elseif (b <= 1.5e+206) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = b * (a * -0.25); tmp = 0.0; if (b <= -1.25e-52) tmp = t_2; elseif (b <= 1.16e-200) tmp = t_1; elseif (b <= 1.2e-147) tmp = (t * z) * 0.0625; elseif (b <= 1.5e+206) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.25e-52], t$95$2, If[LessEqual[b, 1.16e-200], t$95$1, If[LessEqual[b, 1.2e-147], N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[b, 1.5e+206], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{-52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 1.16 \cdot 10^{-200}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{-147}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -1.25e-52 or 1.5000000000000001e206 < b Initial program 95.8%
associate-+l-95.8%
sub-neg95.8%
neg-mul-195.8%
metadata-eval95.8%
metadata-eval95.8%
cancel-sign-sub-inv95.8%
fma-def97.9%
associate-/l*97.9%
metadata-eval97.9%
*-lft-identity97.9%
associate-/l*97.8%
Simplified97.8%
fma-udef95.7%
associate-/l*95.7%
+-commutative95.7%
div-inv95.7%
metadata-eval95.7%
Applied egg-rr95.7%
Taylor expanded in a around inf 51.7%
associate-*r*51.7%
Simplified51.7%
if -1.25e-52 < b < 1.1600000000000001e-200 or 1.19999999999999999e-147 < b < 1.5000000000000001e206Initial program 97.3%
Taylor expanded in a around 0 84.0%
Taylor expanded in t around 0 64.1%
if 1.1600000000000001e-200 < b < 1.19999999999999999e-147Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-/l*99.5%
Simplified99.5%
fma-udef99.5%
associate-/l*99.7%
+-commutative99.7%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 77.7%
Taylor expanded in t around inf 57.6%
Final simplification59.2%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -7e-180) (* x y) (if (<= y 9.6e-9) (* (* t z) 0.0625) (if (<= y 1e+71) c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -7e-180) {
tmp = x * y;
} else if (y <= 9.6e-9) {
tmp = (t * z) * 0.0625;
} else if (y <= 1e+71) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
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 (y <= (-7d-180)) then
tmp = x * y
else if (y <= 9.6d-9) then
tmp = (t * z) * 0.0625d0
else if (y <= 1d+71) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -7e-180) {
tmp = x * y;
} else if (y <= 9.6e-9) {
tmp = (t * z) * 0.0625;
} else if (y <= 1e+71) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -7e-180: tmp = x * y elif y <= 9.6e-9: tmp = (t * z) * 0.0625 elif y <= 1e+71: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -7e-180) tmp = Float64(x * y); elseif (y <= 9.6e-9) tmp = Float64(Float64(t * z) * 0.0625); elseif (y <= 1e+71) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -7e-180) tmp = x * y; elseif (y <= 9.6e-9) tmp = (t * z) * 0.0625; elseif (y <= 1e+71) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -7e-180], N[(x * y), $MachinePrecision], If[LessEqual[y, 9.6e-9], N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[y, 1e+71], c, N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-180}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-9}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\
\mathbf{elif}\;y \leq 10^{+71}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -7.0000000000000001e-180 or 1e71 < y Initial program 94.6%
Taylor expanded in z around 0 85.1%
Taylor expanded in c around 0 68.8%
Taylor expanded in y around inf 43.8%
if -7.0000000000000001e-180 < y < 9.5999999999999999e-9Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-/l*99.7%
Simplified99.7%
fma-udef99.7%
associate-/l*99.8%
+-commutative99.8%
div-inv99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 90.4%
Taylor expanded in t around inf 35.6%
if 9.5999999999999999e-9 < y < 1e71Initial program 100.0%
Taylor expanded in c around inf 43.7%
Final simplification40.7%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -9.6e-150) (* x y) (if (<= y 9.5e+70) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -9.6e-150) {
tmp = x * y;
} else if (y <= 9.5e+70) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
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 (y <= (-9.6d-150)) then
tmp = x * y
else if (y <= 9.5d+70) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -9.6e-150) {
tmp = x * y;
} else if (y <= 9.5e+70) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -9.6e-150: tmp = x * y elif y <= 9.5e+70: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -9.6e-150) tmp = Float64(x * y); elseif (y <= 9.5e+70) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -9.6e-150) tmp = x * y; elseif (y <= 9.5e+70) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -9.6e-150], N[(x * y), $MachinePrecision], If[LessEqual[y, 9.5e+70], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{-150}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -9.6e-150 or 9.5000000000000002e70 < y Initial program 94.3%
Taylor expanded in z around 0 85.8%
Taylor expanded in c around 0 70.7%
Taylor expanded in y around inf 45.9%
if -9.6e-150 < y < 9.5000000000000002e70Initial program 100.0%
Taylor expanded in c around inf 28.9%
Final simplification38.2%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return 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 = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.9%
Taylor expanded in c around inf 22.5%
Final simplification22.5%
herbie shell --seed 2023240
(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))