
(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 13 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 (+ (- (fma 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 (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right) + c
\end{array}
Initial program 97.8%
associate-+l-97.8%
+-commutative97.8%
*-commutative97.8%
+-commutative97.8%
associate-+l-97.8%
fma-define98.2%
*-commutative98.2%
associate-/l*98.5%
associate-/l*98.8%
Simplified98.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -3.6e+124)
t_2
(if (<= (* x y) -5e-312)
t_1
(if (<= (* x y) 1.55e-191)
(+ c (* z (* t 0.0625)))
(if (<= (* x y) 2e+193) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -3.6e+124) {
tmp = t_2;
} else if ((x * y) <= -5e-312) {
tmp = t_1;
} else if ((x * y) <= 1.55e-191) {
tmp = c + (z * (t * 0.0625));
} else if ((x * y) <= 2e+193) {
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 + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-3.6d+124)) then
tmp = t_2
else if ((x * y) <= (-5d-312)) then
tmp = t_1
else if ((x * y) <= 1.55d-191) then
tmp = c + (z * (t * 0.0625d0))
else if ((x * y) <= 2d+193) 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 + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -3.6e+124) {
tmp = t_2;
} else if ((x * y) <= -5e-312) {
tmp = t_1;
} else if ((x * y) <= 1.55e-191) {
tmp = c + (z * (t * 0.0625));
} else if ((x * y) <= 2e+193) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -3.6e+124: tmp = t_2 elif (x * y) <= -5e-312: tmp = t_1 elif (x * y) <= 1.55e-191: tmp = c + (z * (t * 0.0625)) elif (x * y) <= 2e+193: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -3.6e+124) tmp = t_2; elseif (Float64(x * y) <= -5e-312) tmp = t_1; elseif (Float64(x * y) <= 1.55e-191) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); elseif (Float64(x * y) <= 2e+193) 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 + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -3.6e+124) tmp = t_2; elseif ((x * y) <= -5e-312) tmp = t_1; elseif ((x * y) <= 1.55e-191) tmp = c + (z * (t * 0.0625)); elseif ((x * y) <= 2e+193) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.6e+124], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e-312], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e-191], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+193], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -3.6 \cdot 10^{+124}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-312}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-191}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -3.59999999999999986e124 or 2.00000000000000013e193 < (*.f64 x y) Initial program 94.3%
associate-+l-94.3%
+-commutative94.3%
*-commutative94.3%
+-commutative94.3%
associate-+l-94.3%
fma-define95.8%
*-commutative95.8%
associate-/l*97.0%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in x around inf 84.8%
Taylor expanded in x around inf 80.7%
if -3.59999999999999986e124 < (*.f64 x y) < -5.0000000000022e-312 or 1.5500000000000001e-191 < (*.f64 x y) < 2.00000000000000013e193Initial program 98.9%
associate--l+98.9%
fma-define98.9%
associate-/l*98.9%
fmm-def98.9%
distribute-neg-frac298.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in a around inf 70.9%
*-commutative70.9%
associate-*r*71.4%
Simplified71.4%
if -5.0000000000022e-312 < (*.f64 x y) < 1.5500000000000001e-191Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in a around 0 84.2%
*-commutative84.2%
*-commutative84.2%
associate-*r*84.2%
*-commutative84.2%
Simplified84.2%
Final simplification75.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= (* x y) -4.7e+121)
(* x y)
(if (<= (* x y) -2.1e+34)
t_1
(if (<= (* x y) 1.15e-39) c (if (<= (* x y) 2e+193) t_1 (* 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 ((x * y) <= -4.7e+121) {
tmp = x * y;
} else if ((x * y) <= -2.1e+34) {
tmp = t_1;
} else if ((x * y) <= 1.15e-39) {
tmp = c;
} else if ((x * y) <= 2e+193) {
tmp = t_1;
} 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 ((x * y) <= (-4.7d+121)) then
tmp = x * y
else if ((x * y) <= (-2.1d+34)) then
tmp = t_1
else if ((x * y) <= 1.15d-39) then
tmp = c
else if ((x * y) <= 2d+193) then
tmp = t_1
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 ((x * y) <= -4.7e+121) {
tmp = x * y;
} else if ((x * y) <= -2.1e+34) {
tmp = t_1;
} else if ((x * y) <= 1.15e-39) {
tmp = c;
} else if ((x * y) <= 2e+193) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) tmp = 0 if (x * y) <= -4.7e+121: tmp = x * y elif (x * y) <= -2.1e+34: tmp = t_1 elif (x * y) <= 1.15e-39: tmp = c elif (x * y) <= 2e+193: tmp = t_1 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 (Float64(x * y) <= -4.7e+121) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.1e+34) tmp = t_1; elseif (Float64(x * y) <= 1.15e-39) tmp = c; elseif (Float64(x * y) <= 2e+193) tmp = t_1; 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 ((x * y) <= -4.7e+121) tmp = x * y; elseif ((x * y) <= -2.1e+34) tmp = t_1; elseif ((x * y) <= 1.15e-39) tmp = c; elseif ((x * y) <= 2e+193) tmp = t_1; 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[N[(x * y), $MachinePrecision], -4.7e+121], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.1e+34], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.15e-39], c, If[LessEqual[N[(x * y), $MachinePrecision], 2e+193], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -4.7 \cdot 10^{+121}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.1 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-39}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.70000000000000005e121 or 2.00000000000000013e193 < (*.f64 x y) Initial program 94.3%
associate-+l-94.3%
+-commutative94.3%
*-commutative94.3%
+-commutative94.3%
associate-+l-94.3%
fma-define95.8%
*-commutative95.8%
associate-/l*97.0%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in x around inf 84.8%
Taylor expanded in x around inf 80.7%
Taylor expanded in x around inf 73.8%
if -4.70000000000000005e121 < (*.f64 x y) < -2.10000000000000017e34 or 1.15000000000000004e-39 < (*.f64 x y) < 2.00000000000000013e193Initial program 98.7%
Taylor expanded in b around inf 88.3%
Taylor expanded in t around inf 84.9%
associate-*r/84.9%
Simplified84.9%
Taylor expanded in c around 0 66.2%
Taylor expanded in t around 0 52.7%
if -2.10000000000000017e34 < (*.f64 x y) < 1.15000000000000004e-39Initial program 99.2%
associate--l+99.2%
fma-define99.2%
associate-/l*99.2%
fmm-def99.2%
distribute-neg-frac299.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in a around inf 68.2%
*-commutative68.2%
associate-*r*68.2%
Simplified68.2%
Taylor expanded in a around 0 40.7%
Final simplification52.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -4e+127)
(+ c (* b (- (/ (* (* z t) 0.0625) b) (* a 0.25))))
(if (<= (* a b) 2e+107)
(+ c (+ (+ (* x y) (* a (* b 0.25))) (* z (* t 0.0625))))
(+ c (- (* x y) (* a (/ b 4.0)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -4e+127) {
tmp = c + (b * ((((z * t) * 0.0625) / b) - (a * 0.25)));
} else if ((a * b) <= 2e+107) {
tmp = c + (((x * y) + (a * (b * 0.25))) + (z * (t * 0.0625)));
} else {
tmp = c + ((x * y) - (a * (b / 4.0)));
}
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 ((a * b) <= (-4d+127)) then
tmp = c + (b * ((((z * t) * 0.0625d0) / b) - (a * 0.25d0)))
else if ((a * b) <= 2d+107) then
tmp = c + (((x * y) + (a * (b * 0.25d0))) + (z * (t * 0.0625d0)))
else
tmp = c + ((x * y) - (a * (b / 4.0d0)))
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 ((a * b) <= -4e+127) {
tmp = c + (b * ((((z * t) * 0.0625) / b) - (a * 0.25)));
} else if ((a * b) <= 2e+107) {
tmp = c + (((x * y) + (a * (b * 0.25))) + (z * (t * 0.0625)));
} else {
tmp = c + ((x * y) - (a * (b / 4.0)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -4e+127: tmp = c + (b * ((((z * t) * 0.0625) / b) - (a * 0.25))) elif (a * b) <= 2e+107: tmp = c + (((x * y) + (a * (b * 0.25))) + (z * (t * 0.0625))) else: tmp = c + ((x * y) - (a * (b / 4.0))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -4e+127) tmp = Float64(c + Float64(b * Float64(Float64(Float64(Float64(z * t) * 0.0625) / b) - Float64(a * 0.25)))); elseif (Float64(a * b) <= 2e+107) tmp = Float64(c + Float64(Float64(Float64(x * y) + Float64(a * Float64(b * 0.25))) + Float64(z * Float64(t * 0.0625)))); else tmp = Float64(c + Float64(Float64(x * y) - Float64(a * Float64(b / 4.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -4e+127) tmp = c + (b * ((((z * t) * 0.0625) / b) - (a * 0.25))); elseif ((a * b) <= 2e+107) tmp = c + (((x * y) + (a * (b * 0.25))) + (z * (t * 0.0625))); else tmp = c + ((x * y) - (a * (b / 4.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -4e+127], N[(c + N[(b * N[(N[(N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision] / b), $MachinePrecision] - N[(a * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+107], N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(a * N[(b * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+127}:\\
\;\;\;\;c + b \cdot \left(\frac{\left(z \cdot t\right) \cdot 0.0625}{b} - a \cdot 0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+107}:\\
\;\;\;\;c + \left(\left(x \cdot y + a \cdot \left(b \cdot 0.25\right)\right) + z \cdot \left(t \cdot 0.0625\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y - a \cdot \frac{b}{4}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -3.99999999999999982e127Initial program 98.2%
Taylor expanded in b around inf 100.0%
Taylor expanded in t around inf 95.3%
associate-*r/95.3%
Simplified95.3%
if -3.99999999999999982e127 < (*.f64 a b) < 1.9999999999999999e107Initial program 98.9%
associate--l+98.9%
fma-define99.5%
associate-/l*100.0%
fmm-def100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
fma-undefine99.4%
fma-undefine99.4%
associate-*r/98.9%
add-sqr-sqrt58.8%
sqrt-unprod96.5%
frac-times96.5%
metadata-eval96.5%
metadata-eval96.5%
frac-times96.5%
sqrt-unprod57.7%
add-sqr-sqrt94.5%
associate-+l+94.5%
+-commutative94.5%
associate-+l+94.5%
associate-*r/95.0%
div-inv95.0%
metadata-eval95.0%
div-inv95.0%
associate-*r*95.0%
Applied egg-rr95.0%
if 1.9999999999999999e107 < (*.f64 a b) Initial program 94.0%
associate-+l-94.0%
+-commutative94.0%
*-commutative94.0%
+-commutative94.0%
associate-+l-94.0%
fma-define94.0%
*-commutative94.0%
associate-/l*94.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 90.6%
Final simplification94.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -4e+90) (not (<= (* a b) 2e+107))) (+ c (- (* x y) (* a (/ b 4.0)))) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -4e+90) || !((a * b) <= 2e+107)) {
tmp = c + ((x * y) - (a * (b / 4.0)));
} else {
tmp = c + ((x * y) + ((z * t) * 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 (((a * b) <= (-4d+90)) .or. (.not. ((a * b) <= 2d+107))) then
tmp = c + ((x * y) - (a * (b / 4.0d0)))
else
tmp = c + ((x * y) + ((z * t) * 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 (((a * b) <= -4e+90) || !((a * b) <= 2e+107)) {
tmp = c + ((x * y) - (a * (b / 4.0)));
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -4e+90) or not ((a * b) <= 2e+107): tmp = c + ((x * y) - (a * (b / 4.0))) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -4e+90) || !(Float64(a * b) <= 2e+107)) tmp = Float64(c + Float64(Float64(x * y) - Float64(a * Float64(b / 4.0)))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -4e+90) || ~(((a * b) <= 2e+107))) tmp = c + ((x * y) - (a * (b / 4.0))); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -4e+90], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+107]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+90} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+107}\right):\\
\;\;\;\;c + \left(x \cdot y - a \cdot \frac{b}{4}\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -3.99999999999999987e90 or 1.9999999999999999e107 < (*.f64 a b) Initial program 96.2%
associate-+l-96.2%
+-commutative96.2%
*-commutative96.2%
+-commutative96.2%
associate-+l-96.2%
fma-define96.2%
*-commutative96.2%
associate-/l*96.2%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in x around inf 90.5%
if -3.99999999999999987e90 < (*.f64 a b) < 1.9999999999999999e107Initial program 98.8%
Taylor expanded in b around inf 79.0%
Taylor expanded in b around 0 95.4%
Final simplification93.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)))
(if (<= (* a b) -5e+146)
(+ c (* b (- (/ t_1 b) (* a 0.25))))
(if (<= (* a b) 2e+107)
(+ c (+ (* x y) t_1))
(+ c (- (* x y) (* a (/ b 4.0))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5e+146) {
tmp = c + (b * ((t_1 / b) - (a * 0.25)));
} else if ((a * b) <= 2e+107) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + ((x * y) - (a * (b / 4.0)));
}
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 = (z * t) * 0.0625d0
if ((a * b) <= (-5d+146)) then
tmp = c + (b * ((t_1 / b) - (a * 0.25d0)))
else if ((a * b) <= 2d+107) then
tmp = c + ((x * y) + t_1)
else
tmp = c + ((x * y) - (a * (b / 4.0d0)))
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 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5e+146) {
tmp = c + (b * ((t_1 / b) - (a * 0.25)));
} else if ((a * b) <= 2e+107) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + ((x * y) - (a * (b / 4.0)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 tmp = 0 if (a * b) <= -5e+146: tmp = c + (b * ((t_1 / b) - (a * 0.25))) elif (a * b) <= 2e+107: tmp = c + ((x * y) + t_1) else: tmp = c + ((x * y) - (a * (b / 4.0))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (Float64(a * b) <= -5e+146) tmp = Float64(c + Float64(b * Float64(Float64(t_1 / b) - Float64(a * 0.25)))); elseif (Float64(a * b) <= 2e+107) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(c + Float64(Float64(x * y) - Float64(a * Float64(b / 4.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; tmp = 0.0; if ((a * b) <= -5e+146) tmp = c + (b * ((t_1 / b) - (a * 0.25))); elseif ((a * b) <= 2e+107) tmp = c + ((x * y) + t_1); else tmp = c + ((x * y) - (a * (b / 4.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+146], N[(c + N[(b * N[(N[(t$95$1 / b), $MachinePrecision] - N[(a * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+107], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+146}:\\
\;\;\;\;c + b \cdot \left(\frac{t\_1}{b} - a \cdot 0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+107}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y - a \cdot \frac{b}{4}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e146Initial program 97.9%
Taylor expanded in b around inf 100.0%
Taylor expanded in t around inf 97.2%
associate-*r/97.2%
Simplified97.2%
if -4.9999999999999999e146 < (*.f64 a b) < 1.9999999999999999e107Initial program 98.9%
Taylor expanded in b around inf 80.0%
Taylor expanded in b around 0 94.2%
if 1.9999999999999999e107 < (*.f64 a b) Initial program 94.0%
associate-+l-94.0%
+-commutative94.0%
*-commutative94.0%
+-commutative94.0%
associate-+l-94.0%
fma-define94.0%
*-commutative94.0%
associate-/l*94.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 90.6%
Final simplification93.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)))
(if (<= (* a b) -5e+146)
(+ c (- t_1 (* (* a b) 0.25)))
(if (<= (* a b) 2e+107)
(+ c (+ (* x y) t_1))
(+ c (- (* x y) (* a (/ b 4.0))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5e+146) {
tmp = c + (t_1 - ((a * b) * 0.25));
} else if ((a * b) <= 2e+107) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + ((x * y) - (a * (b / 4.0)));
}
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 = (z * t) * 0.0625d0
if ((a * b) <= (-5d+146)) then
tmp = c + (t_1 - ((a * b) * 0.25d0))
else if ((a * b) <= 2d+107) then
tmp = c + ((x * y) + t_1)
else
tmp = c + ((x * y) - (a * (b / 4.0d0)))
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 = (z * t) * 0.0625;
double tmp;
if ((a * b) <= -5e+146) {
tmp = c + (t_1 - ((a * b) * 0.25));
} else if ((a * b) <= 2e+107) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + ((x * y) - (a * (b / 4.0)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 tmp = 0 if (a * b) <= -5e+146: tmp = c + (t_1 - ((a * b) * 0.25)) elif (a * b) <= 2e+107: tmp = c + ((x * y) + t_1) else: tmp = c + ((x * y) - (a * (b / 4.0))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (Float64(a * b) <= -5e+146) tmp = Float64(c + Float64(t_1 - Float64(Float64(a * b) * 0.25))); elseif (Float64(a * b) <= 2e+107) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(c + Float64(Float64(x * y) - Float64(a * Float64(b / 4.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; tmp = 0.0; if ((a * b) <= -5e+146) tmp = c + (t_1 - ((a * b) * 0.25)); elseif ((a * b) <= 2e+107) tmp = c + ((x * y) + t_1); else tmp = c + ((x * y) - (a * (b / 4.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+146], N[(c + N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+107], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+146}:\\
\;\;\;\;c + \left(t\_1 - \left(a \cdot b\right) \cdot 0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+107}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y - a \cdot \frac{b}{4}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e146Initial program 97.9%
Taylor expanded in x around 0 95.2%
if -4.9999999999999999e146 < (*.f64 a b) < 1.9999999999999999e107Initial program 98.9%
Taylor expanded in b around inf 80.0%
Taylor expanded in b around 0 94.2%
if 1.9999999999999999e107 < (*.f64 a b) Initial program 94.0%
associate-+l-94.0%
+-commutative94.0%
*-commutative94.0%
+-commutative94.0%
associate-+l-94.0%
fma-define94.0%
*-commutative94.0%
associate-/l*94.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 90.6%
Final simplification93.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -3e+189) (not (<= a 4.6e-70))) (+ c (* a (* b -0.25))) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -3e+189) || !(a <= 4.6e-70)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + ((z * t) * 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 ((a <= (-3d+189)) .or. (.not. (a <= 4.6d-70))) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = c + ((x * y) + ((z * t) * 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 ((a <= -3e+189) || !(a <= 4.6e-70)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -3e+189) or not (a <= 4.6e-70): tmp = c + (a * (b * -0.25)) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -3e+189) || !(a <= 4.6e-70)) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a <= -3e+189) || ~((a <= 4.6e-70))) tmp = c + (a * (b * -0.25)); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -3e+189], N[Not[LessEqual[a, 4.6e-70]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+189} \lor \neg \left(a \leq 4.6 \cdot 10^{-70}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if a < -2.9999999999999998e189 or 4.60000000000000001e-70 < a Initial program 96.5%
associate--l+96.5%
fma-define96.5%
associate-/l*97.3%
fmm-def97.3%
distribute-neg-frac297.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in a around inf 69.2%
*-commutative69.2%
associate-*r*69.9%
Simplified69.9%
if -2.9999999999999998e189 < a < 4.60000000000000001e-70Initial program 98.7%
Taylor expanded in b around inf 86.3%
Taylor expanded in b around 0 85.0%
Final simplification78.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.6e+121) (not (<= (* x y) 6.4e+128))) (+ c (* x y)) (+ c (* z (* t 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.6e+121) || !((x * y) <= 6.4e+128)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 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 (((x * y) <= (-2.6d+121)) .or. (.not. ((x * y) <= 6.4d+128))) then
tmp = c + (x * y)
else
tmp = c + (z * (t * 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 (((x * y) <= -2.6e+121) || !((x * y) <= 6.4e+128)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.6e+121) or not ((x * y) <= 6.4e+128): tmp = c + (x * y) else: tmp = c + (z * (t * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.6e+121) || !(Float64(x * y) <= 6.4e+128)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(z * Float64(t * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -2.6e+121) || ~(((x * y) <= 6.4e+128))) tmp = c + (x * y); else tmp = c + (z * (t * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.6e+121], N[Not[LessEqual[N[(x * y), $MachinePrecision], 6.4e+128]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{+121} \lor \neg \left(x \cdot y \leq 6.4 \cdot 10^{+128}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.5999999999999999e121 or 6.39999999999999971e128 < (*.f64 x y) Initial program 95.1%
associate-+l-95.1%
+-commutative95.1%
*-commutative95.1%
+-commutative95.1%
associate-+l-95.1%
fma-define96.4%
*-commutative96.4%
associate-/l*97.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in x around inf 86.9%
Taylor expanded in x around inf 75.9%
if -2.5999999999999999e121 < (*.f64 x y) < 6.39999999999999971e128Initial program 99.0%
Taylor expanded in x around 0 94.0%
Taylor expanded in a around 0 61.9%
*-commutative61.9%
*-commutative61.9%
associate-*r*61.9%
*-commutative61.9%
Simplified61.9%
Final simplification66.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.3e+23) (not (<= (* x y) 2e+208))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.3e+23) || !((x * y) <= 2e+208)) {
tmp = x * y;
} else {
tmp = c;
}
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 (((x * y) <= (-2.3d+23)) .or. (.not. ((x * y) <= 2d+208))) then
tmp = x * y
else
tmp = c
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 (((x * y) <= -2.3e+23) || !((x * y) <= 2e+208)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.3e+23) or not ((x * y) <= 2e+208): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.3e+23) || !(Float64(x * y) <= 2e+208)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -2.3e+23) || ~(((x * y) <= 2e+208))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.3e+23], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+208]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.3 \cdot 10^{+23} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+208}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.3e23 or 2e208 < (*.f64 x y) Initial program 95.2%
associate-+l-95.2%
+-commutative95.2%
*-commutative95.2%
+-commutative95.2%
associate-+l-95.2%
fma-define96.5%
*-commutative96.5%
associate-/l*97.5%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in x around inf 82.4%
Taylor expanded in x around inf 70.5%
Taylor expanded in x around inf 64.7%
if -2.3e23 < (*.f64 x y) < 2e208Initial program 99.0%
associate--l+99.0%
fma-define99.0%
associate-/l*99.0%
fmm-def99.0%
distribute-neg-frac299.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in a around inf 69.8%
*-commutative69.8%
associate-*r*70.2%
Simplified70.2%
Taylor expanded in a around 0 37.0%
Final simplification45.7%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
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 + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 97.8%
Final simplification97.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -3000000000.0) (not (<= b 6.2e+151))) (* b (* a -0.25)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -3000000000.0) || !(b <= 6.2e+151)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (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 ((b <= (-3000000000.0d0)) .or. (.not. (b <= 6.2d+151))) then
tmp = b * (a * (-0.25d0))
else
tmp = c + (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 ((b <= -3000000000.0) || !(b <= 6.2e+151)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -3000000000.0) or not (b <= 6.2e+151): tmp = b * (a * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -3000000000.0) || !(b <= 6.2e+151)) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -3000000000.0) || ~((b <= 6.2e+151))) tmp = b * (a * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -3000000000.0], N[Not[LessEqual[b, 6.2e+151]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3000000000 \lor \neg \left(b \leq 6.2 \cdot 10^{+151}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if b < -3e9 or 6.2000000000000004e151 < b Initial program 97.3%
Taylor expanded in b around inf 99.0%
Taylor expanded in t around inf 80.9%
associate-*r/80.9%
Simplified80.9%
Taylor expanded in c around 0 66.8%
Taylor expanded in t around 0 47.4%
if -3e9 < b < 6.2000000000000004e151Initial program 98.2%
associate-+l-98.2%
+-commutative98.2%
*-commutative98.2%
+-commutative98.2%
associate-+l-98.2%
fma-define98.8%
*-commutative98.8%
associate-/l*99.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around inf 74.2%
Taylor expanded in x around inf 58.7%
Final simplification54.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 97.8%
associate--l+97.8%
fma-define98.2%
associate-/l*98.5%
fmm-def98.5%
distribute-neg-frac298.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in a around inf 55.2%
*-commutative55.2%
associate-*r*55.5%
Simplified55.5%
Taylor expanded in a around 0 28.0%
herbie shell --seed 2024160
(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))