
(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 15 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 (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
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)));
}
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
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}
\\
\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 97.6%
associate-+l-97.6%
associate--l+97.6%
fma-def98.4%
associate-*l/98.4%
fma-neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
associate-/l*99.2%
distribute-frac-neg99.2%
associate-/r/99.2%
fma-def99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ (+ (fma a (* b -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) {
return (fma(a, (b * -0.25), c) + (x * y)) + (t * (z * 0.0625));
}
function code(x, y, z, t, a, b, c) return Float64(Float64(fma(a, Float64(b * -0.25), c) + Float64(x * y)) + Float64(t * Float64(z * 0.0625))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(a, b \cdot -0.25, c\right) + x \cdot y\right) + t \cdot \left(z \cdot 0.0625\right)
\end{array}
Initial program 97.6%
associate-+l-97.6%
associate--l+97.6%
fma-def98.4%
associate-*l/98.4%
fma-neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
associate-/l*99.2%
distribute-frac-neg99.2%
associate-/r/99.2%
fma-def99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.2%
metadata-eval99.2%
Simplified99.2%
fma-udef98.4%
fma-udef97.6%
associate-*l/97.6%
fma-udef97.6%
associate-/r/97.6%
associate-+r+97.6%
associate-*l/97.6%
fma-udef98.4%
+-commutative98.4%
fma-udef97.6%
associate-*l/97.6%
associate-+r+97.6%
div-inv97.6%
fma-def97.6%
clear-num97.6%
div-inv97.6%
metadata-eval97.6%
associate-*l/97.6%
Applied egg-rr97.6%
Final simplification97.6%
(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(Float64(z / 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[(N[(z / 16.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(c + \frac{a}{\frac{-4}{b}}\right)
\end{array}
Initial program 97.6%
sub-neg97.6%
associate-+l+97.6%
fma-def98.4%
associate-*l/98.4%
distribute-frac-neg98.4%
distribute-rgt-neg-out98.4%
associate-/l*98.4%
neg-mul-198.4%
associate-/r*98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* z t)))) (t_2 (+ c (* a (* b -0.25)))))
(if (<= (* x y) -9.5e+167)
(* x y)
(if (<= (* x y) -3.6e-304)
t_1
(if (<= (* x y) 2e-306)
t_2
(if (<= (* x y) 5.7e-123)
t_1
(if (<= (* x y) 7e+138) t_2 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (z * t));
double t_2 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -9.5e+167) {
tmp = x * y;
} else if ((x * y) <= -3.6e-304) {
tmp = t_1;
} else if ((x * y) <= 2e-306) {
tmp = t_2;
} else if ((x * y) <= 5.7e-123) {
tmp = t_1;
} else if ((x * y) <= 7e+138) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = c + (0.0625d0 * (z * t))
t_2 = c + (a * (b * (-0.25d0)))
if ((x * y) <= (-9.5d+167)) then
tmp = x * y
else if ((x * y) <= (-3.6d-304)) then
tmp = t_1
else if ((x * y) <= 2d-306) then
tmp = t_2
else if ((x * y) <= 5.7d-123) then
tmp = t_1
else if ((x * y) <= 7d+138) then
tmp = t_2
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 = c + (0.0625 * (z * t));
double t_2 = c + (a * (b * -0.25));
double tmp;
if ((x * y) <= -9.5e+167) {
tmp = x * y;
} else if ((x * y) <= -3.6e-304) {
tmp = t_1;
} else if ((x * y) <= 2e-306) {
tmp = t_2;
} else if ((x * y) <= 5.7e-123) {
tmp = t_1;
} else if ((x * y) <= 7e+138) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (z * t)) t_2 = c + (a * (b * -0.25)) tmp = 0 if (x * y) <= -9.5e+167: tmp = x * y elif (x * y) <= -3.6e-304: tmp = t_1 elif (x * y) <= 2e-306: tmp = t_2 elif (x * y) <= 5.7e-123: tmp = t_1 elif (x * y) <= 7e+138: tmp = t_2 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(z * t))) t_2 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (Float64(x * y) <= -9.5e+167) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.6e-304) tmp = t_1; elseif (Float64(x * y) <= 2e-306) tmp = t_2; elseif (Float64(x * y) <= 5.7e-123) tmp = t_1; elseif (Float64(x * y) <= 7e+138) tmp = t_2; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (0.0625 * (z * t)); t_2 = c + (a * (b * -0.25)); tmp = 0.0; if ((x * y) <= -9.5e+167) tmp = x * y; elseif ((x * y) <= -3.6e-304) tmp = t_1; elseif ((x * y) <= 2e-306) tmp = t_2; elseif ((x * y) <= 5.7e-123) tmp = t_1; elseif ((x * y) <= 7e+138) tmp = t_2; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9.5e+167], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.6e-304], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-306], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.7e-123], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 7e+138], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+167}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.6 \cdot 10^{-304}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-306}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 5.7 \cdot 10^{-123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+138}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.5000000000000006e167 or 6.9999999999999996e138 < (*.f64 x y) Initial program 91.8%
associate-+l-91.8%
associate--l+91.8%
fma-def94.5%
associate-*l/94.5%
fma-neg97.3%
sub-neg97.3%
distribute-neg-in97.3%
remove-double-neg97.3%
associate-/l*97.3%
distribute-frac-neg97.3%
associate-/r/97.3%
fma-def97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
metadata-eval97.3%
Simplified97.3%
fma-udef94.5%
fma-udef91.8%
associate-*l/91.8%
fma-udef91.8%
associate-/r/91.8%
associate-+r+91.8%
associate-*l/91.8%
fma-udef94.5%
+-commutative94.5%
fma-udef91.8%
associate-*l/91.8%
associate-+r+91.8%
div-inv91.8%
fma-def91.8%
clear-num91.8%
div-inv91.8%
metadata-eval91.8%
associate-*l/91.8%
Applied egg-rr91.8%
Taylor expanded in x around inf 81.4%
if -9.5000000000000006e167 < (*.f64 x y) < -3.6000000000000001e-304 or 2.00000000000000006e-306 < (*.f64 x y) < 5.70000000000000027e-123Initial program 100.0%
Taylor expanded in a around 0 76.4%
Taylor expanded in x around 0 68.9%
if -3.6000000000000001e-304 < (*.f64 x y) < 2.00000000000000006e-306 or 5.70000000000000027e-123 < (*.f64 x y) < 6.9999999999999996e138Initial program 100.0%
Taylor expanded in a around inf 69.5%
*-commutative69.5%
associate-*r*69.5%
Simplified69.5%
Final simplification72.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))) (t_2 (* b (* a -0.25))))
(if (<= (* x y) -7.5e+167)
(* x y)
(if (<= (* x y) -4.8e-305)
t_1
(if (<= (* x y) 3.6e-308)
t_2
(if (<= (* x y) 1.4e-124)
t_1
(if (<= (* x y) 1.2e+138) t_2 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double t_2 = b * (a * -0.25);
double tmp;
if ((x * y) <= -7.5e+167) {
tmp = x * y;
} else if ((x * y) <= -4.8e-305) {
tmp = t_1;
} else if ((x * y) <= 3.6e-308) {
tmp = t_2;
} else if ((x * y) <= 1.4e-124) {
tmp = t_1;
} else if ((x * y) <= 1.2e+138) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = t * (z * 0.0625d0)
t_2 = b * (a * (-0.25d0))
if ((x * y) <= (-7.5d+167)) then
tmp = x * y
else if ((x * y) <= (-4.8d-305)) then
tmp = t_1
else if ((x * y) <= 3.6d-308) then
tmp = t_2
else if ((x * y) <= 1.4d-124) then
tmp = t_1
else if ((x * y) <= 1.2d+138) then
tmp = t_2
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 = t * (z * 0.0625);
double t_2 = b * (a * -0.25);
double tmp;
if ((x * y) <= -7.5e+167) {
tmp = x * y;
} else if ((x * y) <= -4.8e-305) {
tmp = t_1;
} else if ((x * y) <= 3.6e-308) {
tmp = t_2;
} else if ((x * y) <= 1.4e-124) {
tmp = t_1;
} else if ((x * y) <= 1.2e+138) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) t_2 = b * (a * -0.25) tmp = 0 if (x * y) <= -7.5e+167: tmp = x * y elif (x * y) <= -4.8e-305: tmp = t_1 elif (x * y) <= 3.6e-308: tmp = t_2 elif (x * y) <= 1.4e-124: tmp = t_1 elif (x * y) <= 1.2e+138: tmp = t_2 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) t_2 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (Float64(x * y) <= -7.5e+167) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.8e-305) tmp = t_1; elseif (Float64(x * y) <= 3.6e-308) tmp = t_2; elseif (Float64(x * y) <= 1.4e-124) tmp = t_1; elseif (Float64(x * y) <= 1.2e+138) tmp = t_2; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = t * (z * 0.0625); t_2 = b * (a * -0.25); tmp = 0.0; if ((x * y) <= -7.5e+167) tmp = x * y; elseif ((x * y) <= -4.8e-305) tmp = t_1; elseif ((x * y) <= 3.6e-308) tmp = t_2; elseif ((x * y) <= 1.4e-124) tmp = t_1; elseif ((x * y) <= 1.2e+138) tmp = t_2; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7.5e+167], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.8e-305], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.6e-308], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-124], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e+138], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
t_2 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+167}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{-305}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{-308}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-124}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+138}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.4999999999999995e167 or 1.2e138 < (*.f64 x y) Initial program 91.8%
associate-+l-91.8%
associate--l+91.8%
fma-def94.5%
associate-*l/94.5%
fma-neg97.3%
sub-neg97.3%
distribute-neg-in97.3%
remove-double-neg97.3%
associate-/l*97.3%
distribute-frac-neg97.3%
associate-/r/97.3%
fma-def97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
metadata-eval97.3%
Simplified97.3%
fma-udef94.5%
fma-udef91.8%
associate-*l/91.8%
fma-udef91.8%
associate-/r/91.8%
associate-+r+91.8%
associate-*l/91.8%
fma-udef94.5%
+-commutative94.5%
fma-udef91.8%
associate-*l/91.8%
associate-+r+91.8%
div-inv91.8%
fma-def91.8%
clear-num91.8%
div-inv91.8%
metadata-eval91.8%
associate-*l/91.8%
Applied egg-rr91.8%
Taylor expanded in x around inf 81.4%
if -7.4999999999999995e167 < (*.f64 x y) < -4.80000000000000039e-305 or 3.5999999999999999e-308 < (*.f64 x y) < 1.39999999999999999e-124Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
fma-def100.0%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-*l/100.0%
fma-udef100.0%
associate-/r/99.9%
associate-+r+99.9%
associate-*l/99.9%
fma-udef99.9%
+-commutative99.9%
fma-udef99.9%
associate-*l/99.9%
associate-+r+99.9%
div-inv99.9%
fma-def99.9%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 43.2%
*-commutative43.2%
associate-*r*43.2%
*-commutative43.2%
Simplified43.2%
if -4.80000000000000039e-305 < (*.f64 x y) < 3.5999999999999999e-308 or 1.39999999999999999e-124 < (*.f64 x y) < 1.2e138Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
fma-def100.0%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-*l/100.0%
fma-udef100.0%
associate-/r/99.9%
associate-+r+99.9%
associate-*l/99.9%
fma-udef99.9%
+-commutative99.9%
fma-udef99.9%
associate-*l/99.9%
associate-+r+99.9%
div-inv99.9%
fma-def99.9%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 49.7%
associate-*r*49.7%
Simplified49.7%
Final simplification56.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* z t)))))
(if (<= (* x y) -1e+168)
(* x y)
(if (<= (* x y) -4.6e-305)
t_1
(if (<= (* x y) 1e-311)
(* b (* a -0.25))
(if (<= (* x y) 3.6e+133) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -1e+168) {
tmp = x * y;
} else if ((x * y) <= -4.6e-305) {
tmp = t_1;
} else if ((x * y) <= 1e-311) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 3.6e+133) {
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 = c + (0.0625d0 * (z * t))
if ((x * y) <= (-1d+168)) then
tmp = x * y
else if ((x * y) <= (-4.6d-305)) then
tmp = t_1
else if ((x * y) <= 1d-311) then
tmp = b * (a * (-0.25d0))
else if ((x * y) <= 3.6d+133) 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 = c + (0.0625 * (z * t));
double tmp;
if ((x * y) <= -1e+168) {
tmp = x * y;
} else if ((x * y) <= -4.6e-305) {
tmp = t_1;
} else if ((x * y) <= 1e-311) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 3.6e+133) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (z * t)) tmp = 0 if (x * y) <= -1e+168: tmp = x * y elif (x * y) <= -4.6e-305: tmp = t_1 elif (x * y) <= 1e-311: tmp = b * (a * -0.25) elif (x * y) <= 3.6e+133: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(z * t))) tmp = 0.0 if (Float64(x * y) <= -1e+168) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.6e-305) tmp = t_1; elseif (Float64(x * y) <= 1e-311) tmp = Float64(b * Float64(a * -0.25)); elseif (Float64(x * y) <= 3.6e+133) 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 = c + (0.0625 * (z * t)); tmp = 0.0; if ((x * y) <= -1e+168) tmp = x * y; elseif ((x * y) <= -4.6e-305) tmp = t_1; elseif ((x * y) <= 1e-311) tmp = b * (a * -0.25); elseif ((x * y) <= 3.6e+133) 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[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+168], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.6e-305], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-311], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.6e+133], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+168}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.6 \cdot 10^{-305}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-311}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999993e167 or 3.59999999999999978e133 < (*.f64 x y) Initial program 92.1%
associate-+l-92.1%
associate--l+92.1%
fma-def94.7%
associate-*l/94.7%
fma-neg97.4%
sub-neg97.4%
distribute-neg-in97.4%
remove-double-neg97.4%
associate-/l*97.4%
distribute-frac-neg97.4%
associate-/r/97.4%
fma-def97.4%
neg-mul-197.4%
*-commutative97.4%
associate-/l*97.4%
metadata-eval97.4%
Simplified97.4%
fma-udef94.7%
fma-udef92.1%
associate-*l/92.1%
fma-udef92.1%
associate-/r/92.1%
associate-+r+92.1%
associate-*l/92.1%
fma-udef94.7%
+-commutative94.7%
fma-udef92.1%
associate-*l/92.1%
associate-+r+92.1%
div-inv92.1%
fma-def92.1%
clear-num92.1%
div-inv92.1%
metadata-eval92.1%
associate-*l/92.1%
Applied egg-rr92.1%
Taylor expanded in x around inf 79.6%
if -9.9999999999999993e167 < (*.f64 x y) < -4.5999999999999999e-305 or 9.99999999999948e-312 < (*.f64 x y) < 3.59999999999999978e133Initial program 100.0%
Taylor expanded in a around 0 72.4%
Taylor expanded in x around 0 65.0%
if -4.5999999999999999e-305 < (*.f64 x y) < 9.99999999999948e-312Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
fma-def100.0%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-*l/100.0%
fma-udef100.0%
associate-/r/99.9%
associate-+r+99.9%
associate-*l/99.9%
fma-udef99.9%
+-commutative99.9%
fma-udef99.9%
associate-*l/99.9%
associate-+r+99.9%
div-inv100.0%
fma-def100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 59.9%
associate-*r*59.9%
Simplified59.9%
Final simplification68.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))))
(if (<= (* x y) -7.5e+167)
(* x y)
(if (<= (* x y) -4.05e+40)
t_1
(if (<= (* x y) -3.8e-14) c (if (<= (* x y) 2.1e+133) t_1 (* x y)))))))
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 ((x * y) <= -7.5e+167) {
tmp = x * y;
} else if ((x * y) <= -4.05e+40) {
tmp = t_1;
} else if ((x * y) <= -3.8e-14) {
tmp = c;
} else if ((x * y) <= 2.1e+133) {
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 = t * (z * 0.0625d0)
if ((x * y) <= (-7.5d+167)) then
tmp = x * y
else if ((x * y) <= (-4.05d+40)) then
tmp = t_1
else if ((x * y) <= (-3.8d-14)) then
tmp = c
else if ((x * y) <= 2.1d+133) 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 = t * (z * 0.0625);
double tmp;
if ((x * y) <= -7.5e+167) {
tmp = x * y;
} else if ((x * y) <= -4.05e+40) {
tmp = t_1;
} else if ((x * y) <= -3.8e-14) {
tmp = c;
} else if ((x * y) <= 2.1e+133) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) tmp = 0 if (x * y) <= -7.5e+167: tmp = x * y elif (x * y) <= -4.05e+40: tmp = t_1 elif (x * y) <= -3.8e-14: tmp = c elif (x * y) <= 2.1e+133: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -7.5e+167) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.05e+40) tmp = t_1; elseif (Float64(x * y) <= -3.8e-14) tmp = c; elseif (Float64(x * y) <= 2.1e+133) 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 = t * (z * 0.0625); tmp = 0.0; if ((x * y) <= -7.5e+167) tmp = x * y; elseif ((x * y) <= -4.05e+40) tmp = t_1; elseif ((x * y) <= -3.8e-14) tmp = c; elseif ((x * y) <= 2.1e+133) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7.5e+167], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.05e+40], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.8e-14], c, If[LessEqual[N[(x * y), $MachinePrecision], 2.1e+133], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+167}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.05 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-14}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.4999999999999995e167 or 2.1e133 < (*.f64 x y) Initial program 92.1%
associate-+l-92.1%
associate--l+92.1%
fma-def94.7%
associate-*l/94.7%
fma-neg97.4%
sub-neg97.4%
distribute-neg-in97.4%
remove-double-neg97.4%
associate-/l*97.4%
distribute-frac-neg97.4%
associate-/r/97.4%
fma-def97.4%
neg-mul-197.4%
*-commutative97.4%
associate-/l*97.4%
metadata-eval97.4%
Simplified97.4%
fma-udef94.7%
fma-udef92.1%
associate-*l/92.1%
fma-udef92.1%
associate-/r/92.1%
associate-+r+92.1%
associate-*l/92.1%
fma-udef94.7%
+-commutative94.7%
fma-udef92.1%
associate-*l/92.1%
associate-+r+92.1%
div-inv92.1%
fma-def92.1%
clear-num92.1%
div-inv92.1%
metadata-eval92.1%
associate-*l/92.1%
Applied egg-rr92.1%
Taylor expanded in x around inf 79.6%
if -7.4999999999999995e167 < (*.f64 x y) < -4.0499999999999999e40 or -3.8000000000000002e-14 < (*.f64 x y) < 2.1e133Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
fma-def100.0%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-*l/100.0%
fma-udef100.0%
associate-/r/99.9%
associate-+r+99.9%
associate-*l/99.9%
fma-udef99.9%
+-commutative99.9%
fma-udef99.9%
associate-*l/99.9%
associate-+r+99.9%
div-inv99.9%
fma-def99.9%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 39.7%
*-commutative39.7%
associate-*r*39.7%
*-commutative39.7%
Simplified39.7%
if -4.0499999999999999e40 < (*.f64 x y) < -3.8000000000000002e-14Initial program 100.0%
Taylor expanded in c around inf 44.3%
Final simplification51.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (- (* x y) (* (* a b) 0.25))))
(if (<= (* a b) -1e+42)
t_2
(if (<= (* a b) 5e-210)
(+ (* x y) t_1)
(if (<= (* a b) 5e+111) (+ c t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -1e+42) {
tmp = t_2;
} else if ((a * b) <= 5e-210) {
tmp = (x * y) + t_1;
} else if ((a * b) <= 5e+111) {
tmp = c + 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 = 0.0625d0 * (z * t)
t_2 = (x * y) - ((a * b) * 0.25d0)
if ((a * b) <= (-1d+42)) then
tmp = t_2
else if ((a * b) <= 5d-210) then
tmp = (x * y) + t_1
else if ((a * b) <= 5d+111) then
tmp = c + 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 = 0.0625 * (z * t);
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -1e+42) {
tmp = t_2;
} else if ((a * b) <= 5e-210) {
tmp = (x * y) + t_1;
} else if ((a * b) <= 5e+111) {
tmp = c + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = (x * y) - ((a * b) * 0.25) tmp = 0 if (a * b) <= -1e+42: tmp = t_2 elif (a * b) <= 5e-210: tmp = (x * y) + t_1 elif (a * b) <= 5e+111: tmp = c + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(a * b) <= -1e+42) tmp = t_2; elseif (Float64(a * b) <= 5e-210) tmp = Float64(Float64(x * y) + t_1); elseif (Float64(a * b) <= 5e+111) tmp = Float64(c + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((a * b) <= -1e+42) tmp = t_2; elseif ((a * b) <= 5e-210) tmp = (x * y) + t_1; elseif ((a * b) <= 5e+111) tmp = c + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+42], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 5e-210], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+111], N[(c + t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-210}:\\
\;\;\;\;x \cdot y + t_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+111}:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e42 or 4.9999999999999997e111 < (*.f64 a b) Initial program 96.1%
Taylor expanded in z around 0 91.8%
Taylor expanded in c around 0 84.3%
if -1.00000000000000004e42 < (*.f64 a b) < 5.0000000000000002e-210Initial program 100.0%
Taylor expanded in a around 0 97.0%
Taylor expanded in c around 0 78.1%
if 5.0000000000000002e-210 < (*.f64 a b) < 4.9999999999999997e111Initial program 96.6%
Taylor expanded in a around 0 89.9%
Taylor expanded in x around 0 74.4%
Final simplification79.7%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= a -1.6e+154)
(not (or (<= a -1.65e+136) (and (not (<= a -4e+83)) (<= a 0.00043)))))
(+ c (* a (* b -0.25)))
(+ (* x y) (* 0.0625 (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.6e+154) || !((a <= -1.65e+136) || (!(a <= -4e+83) && (a <= 0.00043)))) {
tmp = c + (a * (b * -0.25));
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
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 <= (-1.6d+154)) .or. (.not. (a <= (-1.65d+136)) .or. (.not. (a <= (-4d+83))) .and. (a <= 0.00043d0))) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = (x * y) + (0.0625d0 * (z * t))
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 <= -1.6e+154) || !((a <= -1.65e+136) || (!(a <= -4e+83) && (a <= 0.00043)))) {
tmp = c + (a * (b * -0.25));
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -1.6e+154) or not ((a <= -1.65e+136) or (not (a <= -4e+83) and (a <= 0.00043))): tmp = c + (a * (b * -0.25)) else: tmp = (x * y) + (0.0625 * (z * t)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -1.6e+154) || !((a <= -1.65e+136) || (!(a <= -4e+83) && (a <= 0.00043)))) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a <= -1.6e+154) || ~(((a <= -1.65e+136) || (~((a <= -4e+83)) && (a <= 0.00043))))) tmp = c + (a * (b * -0.25)); else tmp = (x * y) + (0.0625 * (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -1.6e+154], N[Not[Or[LessEqual[a, -1.65e+136], And[N[Not[LessEqual[a, -4e+83]], $MachinePrecision], LessEqual[a, 0.00043]]]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+154} \lor \neg \left(a \leq -1.65 \cdot 10^{+136} \lor \neg \left(a \leq -4 \cdot 10^{+83}\right) \land a \leq 0.00043\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if a < -1.6e154 or -1.64999999999999996e136 < a < -4.00000000000000012e83 or 4.29999999999999989e-4 < a Initial program 94.7%
Taylor expanded in a around inf 66.3%
*-commutative66.3%
associate-*r*66.3%
Simplified66.3%
if -1.6e154 < a < -1.64999999999999996e136 or -4.00000000000000012e83 < a < 4.29999999999999989e-4Initial program 99.4%
Taylor expanded in a around 0 85.3%
Taylor expanded in c around 0 63.7%
Final simplification64.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+42) (not (<= (* a b) 5e+111))) (- (* x y) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+42) || !((a * b) <= 5e+111)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
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) <= (-1d+42)) .or. (.not. ((a * b) <= 5d+111))) then
tmp = (x * y) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
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) <= -1e+42) || !((a * b) <= 5e+111)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1e+42) or not ((a * b) <= 5e+111): tmp = (x * y) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1e+42) || !(Float64(a * b) <= 5e+111)) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -1e+42) || ~(((a * b) <= 5e+111))) tmp = (x * y) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+42], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+111]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+42} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+111}\right):\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e42 or 4.9999999999999997e111 < (*.f64 a b) Initial program 96.1%
Taylor expanded in z around 0 91.8%
Taylor expanded in c around 0 84.3%
if -1.00000000000000004e42 < (*.f64 a b) < 4.9999999999999997e111Initial program 98.7%
Taylor expanded in a around 0 94.3%
Final simplification90.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+42) (not (<= (* a b) 5e+111))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1e+42) || !((a * b) <= 5e+111)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
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) <= (-1d+42)) .or. (.not. ((a * b) <= 5d+111))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
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) <= -1e+42) || !((a * b) <= 5e+111)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1e+42) or not ((a * b) <= 5e+111): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1e+42) || !(Float64(a * b) <= 5e+111)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -1e+42) || ~(((a * b) <= 5e+111))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+42], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+111]], $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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+42} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+111}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e42 or 4.9999999999999997e111 < (*.f64 a b) Initial program 96.1%
Taylor expanded in z around 0 91.8%
if -1.00000000000000004e42 < (*.f64 a b) < 4.9999999999999997e111Initial program 98.7%
Taylor expanded in a around 0 94.3%
Final simplification93.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -5e+194)
(- t_2 t_1)
(if (<= (* a b) 5e+111) (+ c (+ (* x y) t_2)) (- (* x y) t_1)))))
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 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+194) {
tmp = t_2 - t_1;
} else if ((a * b) <= 5e+111) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (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) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-5d+194)) then
tmp = t_2 - t_1
else if ((a * b) <= 5d+111) then
tmp = c + ((x * y) + t_2)
else
tmp = (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 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -5e+194) {
tmp = t_2 - t_1;
} else if ((a * b) <= 5e+111) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (x * y) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -5e+194: tmp = t_2 - t_1 elif (a * b) <= 5e+111: tmp = c + ((x * y) + t_2) else: tmp = (x * y) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -5e+194) tmp = Float64(t_2 - t_1); elseif (Float64(a * b) <= 5e+111) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(x * y) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -5e+194) tmp = t_2 - t_1; elseif ((a * b) <= 5e+111) tmp = c + ((x * y) + t_2); else tmp = (x * y) - t_1; end tmp_2 = tmp; end
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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+194], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+111], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+194}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+111}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999989e194Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in c around 0 96.5%
if -4.99999999999999989e194 < (*.f64 a b) < 4.9999999999999997e111Initial program 98.3%
Taylor expanded in a around 0 90.5%
if 4.9999999999999997e111 < (*.f64 a b) Initial program 94.0%
Taylor expanded in z around 0 93.9%
Taylor expanded in c around 0 88.1%
Final simplification90.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -7.5e+167) (not (<= (* x y) 1.2e+113))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -7.5e+167) || !((x * y) <= 1.2e+113)) {
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) <= (-7.5d+167)) .or. (.not. ((x * y) <= 1.2d+113))) 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) <= -7.5e+167) || !((x * y) <= 1.2e+113)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -7.5e+167) or not ((x * y) <= 1.2e+113): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -7.5e+167) || !(Float64(x * y) <= 1.2e+113)) 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) <= -7.5e+167) || ~(((x * y) <= 1.2e+113))) 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], -7.5e+167], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.2e+113]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+167} \lor \neg \left(x \cdot y \leq 1.2 \cdot 10^{+113}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -7.4999999999999995e167 or 1.19999999999999992e113 < (*.f64 x y) Initial program 92.7%
associate-+l-92.7%
associate--l+92.7%
fma-def95.1%
associate-*l/95.1%
fma-neg97.6%
sub-neg97.6%
distribute-neg-in97.6%
remove-double-neg97.6%
associate-/l*97.6%
distribute-frac-neg97.6%
associate-/r/97.6%
fma-def97.6%
neg-mul-197.6%
*-commutative97.6%
associate-/l*97.6%
metadata-eval97.6%
Simplified97.6%
fma-udef95.1%
fma-udef92.7%
associate-*l/92.7%
fma-udef92.7%
associate-/r/92.7%
associate-+r+92.7%
associate-*l/92.7%
fma-udef95.1%
+-commutative95.1%
fma-udef92.7%
associate-*l/92.7%
associate-+r+92.7%
div-inv92.7%
fma-def92.7%
clear-num92.7%
div-inv92.7%
metadata-eval92.7%
associate-*l/92.7%
Applied egg-rr92.7%
Taylor expanded in x around inf 75.2%
if -7.4999999999999995e167 < (*.f64 x y) < 1.19999999999999992e113Initial program 100.0%
Taylor expanded in c around inf 26.4%
Final simplification42.1%
(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.6%
Final simplification97.6%
(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.6%
Taylor expanded in c around inf 19.4%
Final simplification19.4%
herbie shell --seed 2024017
(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))