
(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 (/ 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, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 97.7%
associate--l+97.7%
fma-define98.5%
associate-/l*98.8%
fmm-def99.2%
distribute-neg-frac299.2%
metadata-eval99.2%
Simplified99.2%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma 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 + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 97.7%
associate-+l-97.7%
+-commutative97.7%
*-commutative97.7%
+-commutative97.7%
associate-+l-97.7%
fma-define98.5%
*-commutative98.5%
associate-/l*98.8%
associate-/l*98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* a b) -5e+102)
t_1
(if (<= (* a b) -2e-30)
(+ c (* 0.0625 (* z t)))
(if (<= (* a b) 1e-266)
(+ c (* x y))
(if (<= (* a b) 2e+99) (+ c (* t (* z 0.0625))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -5e+102) {
tmp = t_1;
} else if ((a * b) <= -2e-30) {
tmp = c + (0.0625 * (z * t));
} else if ((a * b) <= 1e-266) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+99) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = 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 = (x * y) - ((a * b) * 0.25d0)
if ((a * b) <= (-5d+102)) then
tmp = t_1
else if ((a * b) <= (-2d-30)) then
tmp = c + (0.0625d0 * (z * t))
else if ((a * b) <= 1d-266) then
tmp = c + (x * y)
else if ((a * b) <= 2d+99) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = 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 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -5e+102) {
tmp = t_1;
} else if ((a * b) <= -2e-30) {
tmp = c + (0.0625 * (z * t));
} else if ((a * b) <= 1e-266) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+99) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if (a * b) <= -5e+102: tmp = t_1 elif (a * b) <= -2e-30: tmp = c + (0.0625 * (z * t)) elif (a * b) <= 1e-266: tmp = c + (x * y) elif (a * b) <= 2e+99: tmp = c + (t * (z * 0.0625)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(a * b) <= -5e+102) tmp = t_1; elseif (Float64(a * b) <= -2e-30) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(a * b) <= 1e-266) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 2e+99) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((a * b) <= -5e+102) tmp = t_1; elseif ((a * b) <= -2e-30) tmp = c + (0.0625 * (z * t)); elseif ((a * b) <= 1e-266) tmp = c + (x * y); elseif ((a * b) <= 2e+99) tmp = c + (t * (z * 0.0625)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+102], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2e-30], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-266], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+99], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-30}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{-266}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+99}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5e102 or 1.9999999999999999e99 < (*.f64 a b) Initial program 96.6%
Taylor expanded in z around 0 88.8%
Taylor expanded in c around 0 88.8%
if -5e102 < (*.f64 a b) < -2e-30Initial program 100.0%
Taylor expanded in a around 0 89.4%
Taylor expanded in x around 0 74.6%
if -2e-30 < (*.f64 a b) < 9.9999999999999998e-267Initial program 97.5%
Taylor expanded in a around 0 96.4%
Taylor expanded in t around 0 71.8%
+-commutative71.8%
Simplified71.8%
if 9.9999999999999998e-267 < (*.f64 a b) < 1.9999999999999999e99Initial program 98.8%
Taylor expanded in x around 0 75.0%
associate--l+75.0%
associate-*r*76.1%
*-commutative76.1%
*-commutative76.1%
associate-*r*76.1%
Applied egg-rr76.1%
Taylor expanded in z around inf 66.5%
associate-*r*67.7%
*-commutative67.7%
associate-*r*67.7%
Simplified67.7%
Final simplification76.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))) (t_2 (* (* a b) -0.25)))
(if (<= (* a b) -2.55e+169)
t_2
(if (<= (* a b) -1.35e-31)
t_1
(if (<= (* a b) 1.9e-262)
(* x y)
(if (<= (* a b) 5.8e+100) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double t_2 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -2.55e+169) {
tmp = t_2;
} else if ((a * b) <= -1.35e-31) {
tmp = t_1;
} else if ((a * b) <= 1.9e-262) {
tmp = x * y;
} else if ((a * b) <= 5.8e+100) {
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 = z * (t * 0.0625d0)
t_2 = (a * b) * (-0.25d0)
if ((a * b) <= (-2.55d+169)) then
tmp = t_2
else if ((a * b) <= (-1.35d-31)) then
tmp = t_1
else if ((a * b) <= 1.9d-262) then
tmp = x * y
else if ((a * b) <= 5.8d+100) 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 = z * (t * 0.0625);
double t_2 = (a * b) * -0.25;
double tmp;
if ((a * b) <= -2.55e+169) {
tmp = t_2;
} else if ((a * b) <= -1.35e-31) {
tmp = t_1;
} else if ((a * b) <= 1.9e-262) {
tmp = x * y;
} else if ((a * b) <= 5.8e+100) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) t_2 = (a * b) * -0.25 tmp = 0 if (a * b) <= -2.55e+169: tmp = t_2 elif (a * b) <= -1.35e-31: tmp = t_1 elif (a * b) <= 1.9e-262: tmp = x * y elif (a * b) <= 5.8e+100: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) t_2 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(a * b) <= -2.55e+169) tmp = t_2; elseif (Float64(a * b) <= -1.35e-31) tmp = t_1; elseif (Float64(a * b) <= 1.9e-262) tmp = Float64(x * y); elseif (Float64(a * b) <= 5.8e+100) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = z * (t * 0.0625); t_2 = (a * b) * -0.25; tmp = 0.0; if ((a * b) <= -2.55e+169) tmp = t_2; elseif ((a * b) <= -1.35e-31) tmp = t_1; elseif ((a * b) <= 1.9e-262) tmp = x * y; elseif ((a * b) <= 5.8e+100) 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[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.55e+169], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1.35e-31], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.9e-262], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.8e+100], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -2.55 \cdot 10^{+169}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -1.35 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.9 \cdot 10^{-262}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 5.8 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.55000000000000004e169 or 5.8000000000000001e100 < (*.f64 a b) Initial program 96.3%
Taylor expanded in x around 0 89.3%
Taylor expanded in t around 0 81.9%
Taylor expanded in c around 0 82.0%
if -2.55000000000000004e169 < (*.f64 a b) < -1.35000000000000007e-31 or 1.9000000000000001e-262 < (*.f64 a b) < 5.8000000000000001e100Initial program 99.1%
Taylor expanded in a around 0 89.7%
Taylor expanded in x around 0 66.1%
Taylor expanded in z around inf 60.0%
Taylor expanded in t around inf 40.8%
if -1.35000000000000007e-31 < (*.f64 a b) < 1.9000000000000001e-262Initial program 97.5%
Taylor expanded in z around 0 72.6%
Taylor expanded in c around 0 48.1%
Taylor expanded in x around inf 46.9%
Final simplification55.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) -0.25)))
(if (<= (* a b) -5e+153)
t_1
(if (<= (* a b) 1e-266)
(+ c (* x y))
(if (<= (* a b) 2e+99) (+ c (* t (* z 0.0625))) 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 tmp;
if ((a * b) <= -5e+153) {
tmp = t_1;
} else if ((a * b) <= 1e-266) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+99) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = 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 = (a * b) * (-0.25d0)
if ((a * b) <= (-5d+153)) then
tmp = t_1
else if ((a * b) <= 1d-266) then
tmp = c + (x * y)
else if ((a * b) <= 2d+99) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = 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 tmp;
if ((a * b) <= -5e+153) {
tmp = t_1;
} else if ((a * b) <= 1e-266) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+99) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * -0.25 tmp = 0 if (a * b) <= -5e+153: tmp = t_1 elif (a * b) <= 1e-266: tmp = c + (x * y) elif (a * b) <= 2e+99: tmp = c + (t * (z * 0.0625)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(a * b) <= -5e+153) tmp = t_1; elseif (Float64(a * b) <= 1e-266) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 2e+99) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * -0.25; tmp = 0.0; if ((a * b) <= -5e+153) tmp = t_1; elseif ((a * b) <= 1e-266) tmp = c + (x * y); elseif ((a * b) <= 2e+99) tmp = c + (t * (z * 0.0625)); else tmp = 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]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+153], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-266], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+99], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-266}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+99}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000018e153 or 1.9999999999999999e99 < (*.f64 a b) Initial program 96.4%
Taylor expanded in x around 0 89.6%
Taylor expanded in t around 0 80.3%
Taylor expanded in c around 0 80.4%
if -5.00000000000000018e153 < (*.f64 a b) < 9.9999999999999998e-267Initial program 98.0%
Taylor expanded in a around 0 95.3%
Taylor expanded in t around 0 67.1%
+-commutative67.1%
Simplified67.1%
if 9.9999999999999998e-267 < (*.f64 a b) < 1.9999999999999999e99Initial program 98.8%
Taylor expanded in x around 0 75.0%
associate--l+75.0%
associate-*r*76.1%
*-commutative76.1%
*-commutative76.1%
associate-*r*76.1%
Applied egg-rr76.1%
Taylor expanded in z around inf 66.5%
associate-*r*67.7%
*-commutative67.7%
associate-*r*67.7%
Simplified67.7%
Final simplification71.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) -0.25)))
(if (<= (* a b) -5.9e+147)
t_1
(if (<= (* a b) 1.25e-257)
(+ c (* x y))
(if (<= (* a b) 1.18e+104) (+ c (* 0.0625 (* z t))) 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 tmp;
if ((a * b) <= -5.9e+147) {
tmp = t_1;
} else if ((a * b) <= 1.25e-257) {
tmp = c + (x * y);
} else if ((a * b) <= 1.18e+104) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = 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 = (a * b) * (-0.25d0)
if ((a * b) <= (-5.9d+147)) then
tmp = t_1
else if ((a * b) <= 1.25d-257) then
tmp = c + (x * y)
else if ((a * b) <= 1.18d+104) then
tmp = c + (0.0625d0 * (z * t))
else
tmp = 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 tmp;
if ((a * b) <= -5.9e+147) {
tmp = t_1;
} else if ((a * b) <= 1.25e-257) {
tmp = c + (x * y);
} else if ((a * b) <= 1.18e+104) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * -0.25 tmp = 0 if (a * b) <= -5.9e+147: tmp = t_1 elif (a * b) <= 1.25e-257: tmp = c + (x * y) elif (a * b) <= 1.18e+104: tmp = c + (0.0625 * (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(a * b) <= -5.9e+147) tmp = t_1; elseif (Float64(a * b) <= 1.25e-257) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 1.18e+104) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * -0.25; tmp = 0.0; if ((a * b) <= -5.9e+147) tmp = t_1; elseif ((a * b) <= 1.25e-257) tmp = c + (x * y); elseif ((a * b) <= 1.18e+104) tmp = c + (0.0625 * (z * t)); else tmp = 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]}, If[LessEqual[N[(a * b), $MachinePrecision], -5.9e+147], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.25e-257], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.18e+104], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -5.9 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.25 \cdot 10^{-257}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.18 \cdot 10^{+104}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.9000000000000001e147 or 1.18e104 < (*.f64 a b) Initial program 96.4%
Taylor expanded in x around 0 89.6%
Taylor expanded in t around 0 80.3%
Taylor expanded in c around 0 80.4%
if -5.9000000000000001e147 < (*.f64 a b) < 1.24999999999999997e-257Initial program 98.0%
Taylor expanded in a around 0 95.3%
Taylor expanded in t around 0 67.1%
+-commutative67.1%
Simplified67.1%
if 1.24999999999999997e-257 < (*.f64 a b) < 1.18e104Initial program 98.8%
Taylor expanded in a around 0 90.5%
Taylor expanded in x around 0 66.5%
Final simplification71.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+173) (not (<= (* a b) 2e+99))) (- (* 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) <= -5e+173) || !((a * b) <= 2e+99)) {
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) <= (-5d+173)) .or. (.not. ((a * b) <= 2d+99))) 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) <= -5e+173) || !((a * b) <= 2e+99)) {
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) <= -5e+173) or not ((a * b) <= 2e+99): 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) <= -5e+173) || !(Float64(a * b) <= 2e+99)) 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) <= -5e+173) || ~(((a * b) <= 2e+99))) 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], -5e+173], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+99]], $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 -5 \cdot 10^{+173} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+99}\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) < -5.00000000000000034e173 or 1.9999999999999999e99 < (*.f64 a b) Initial program 96.3%
Taylor expanded in z around 0 90.3%
Taylor expanded in c around 0 90.3%
if -5.00000000000000034e173 < (*.f64 a b) < 1.9999999999999999e99Initial program 98.4%
Taylor expanded in a around 0 92.8%
Final simplification92.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+153)
(+ c (- (* z (* t 0.0625)) (* b (* a 0.25))))
(if (<= (* a b) 2e+99)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (+ c (* x y)) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+153) {
tmp = c + ((z * (t * 0.0625)) - (b * (a * 0.25)));
} else if ((a * b) <= 2e+99) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
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) <= (-5d+153)) then
tmp = c + ((z * (t * 0.0625d0)) - (b * (a * 0.25d0)))
else if ((a * b) <= 2d+99) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
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) <= -5e+153) {
tmp = c + ((z * (t * 0.0625)) - (b * (a * 0.25)));
} else if ((a * b) <= 2e+99) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+153: tmp = c + ((z * (t * 0.0625)) - (b * (a * 0.25))) elif (a * b) <= 2e+99: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (c + (x * y)) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+153) tmp = Float64(c + Float64(Float64(z * Float64(t * 0.0625)) - Float64(b * Float64(a * 0.25)))); elseif (Float64(a * b) <= 2e+99) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -5e+153) tmp = c + ((z * (t * 0.0625)) - (b * (a * 0.25))); elseif ((a * b) <= 2e+99) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (c + (x * y)) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+153], N[(c + N[(N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision] - N[(b * N[(a * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+99], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+153}:\\
\;\;\;\;c + \left(z \cdot \left(t \cdot 0.0625\right) - b \cdot \left(a \cdot 0.25\right)\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+99}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000018e153Initial program 100.0%
Taylor expanded in x around 0 97.2%
associate--l+97.2%
associate-*r*97.2%
*-commutative97.2%
*-commutative97.2%
associate-*r*97.2%
Applied egg-rr97.2%
if -5.00000000000000018e153 < (*.f64 a b) < 1.9999999999999999e99Initial program 98.3%
Taylor expanded in a around 0 93.3%
if 1.9999999999999999e99 < (*.f64 a b) Initial program 94.0%
Taylor expanded in z around 0 88.0%
Final simplification92.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (<= (* a b) -5e+173)
(- (* x y) t_1)
(if (<= (* a b) 2e+99)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (+ c (* 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 tmp;
if ((a * b) <= -5e+173) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 2e+99) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} 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 = (a * b) * 0.25d0
if ((a * b) <= (-5d+173)) then
tmp = (x * y) - t_1
else if ((a * b) <= 2d+99) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
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 = (a * b) * 0.25;
double tmp;
if ((a * b) <= -5e+173) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 2e+99) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (c + (x * y)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if (a * b) <= -5e+173: tmp = (x * y) - t_1 elif (a * b) <= 2e+99: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (c + (x * y)) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if (Float64(a * b) <= -5e+173) tmp = Float64(Float64(x * y) - t_1); elseif (Float64(a * b) <= 2e+99) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(c + 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; tmp = 0.0; if ((a * b) <= -5e+173) tmp = (x * y) - t_1; elseif ((a * b) <= 2e+99) tmp = c + ((x * y) + (0.0625 * (z * t))); 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[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+173], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+99], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+173}:\\
\;\;\;\;x \cdot y - t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+99}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000034e173Initial program 100.0%
Taylor expanded in z around 0 93.9%
Taylor expanded in c around 0 93.9%
if -5.00000000000000034e173 < (*.f64 a b) < 1.9999999999999999e99Initial program 98.4%
Taylor expanded in a around 0 92.8%
if 1.9999999999999999e99 < (*.f64 a b) Initial program 94.0%
Taylor expanded in z around 0 88.0%
Final simplification92.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1.6e+143) (not (<= (* a b) 1.6e+94))) (* (* a b) -0.25) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -1.6e+143) || !((a * b) <= 1.6e+94)) {
tmp = (a * b) * -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 (((a * b) <= (-1.6d+143)) .or. (.not. ((a * b) <= 1.6d+94))) then
tmp = (a * b) * (-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 (((a * b) <= -1.6e+143) || !((a * b) <= 1.6e+94)) {
tmp = (a * b) * -0.25;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -1.6e+143) or not ((a * b) <= 1.6e+94): tmp = (a * b) * -0.25 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -1.6e+143) || !(Float64(a * b) <= 1.6e+94)) tmp = Float64(Float64(a * b) * -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 (((a * b) <= -1.6e+143) || ~(((a * b) <= 1.6e+94))) tmp = (a * b) * -0.25; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.6e+143], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.6e+94]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+143} \lor \neg \left(a \cdot b \leq 1.6 \cdot 10^{+94}\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -1.60000000000000008e143 or 1.60000000000000007e94 < (*.f64 a b) Initial program 96.5%
Taylor expanded in x around 0 89.9%
Taylor expanded in t around 0 78.5%
Taylor expanded in c around 0 78.6%
if -1.60000000000000008e143 < (*.f64 a b) < 1.60000000000000007e94Initial program 98.3%
Taylor expanded in a around 0 93.3%
Taylor expanded in t around 0 63.2%
+-commutative63.2%
Simplified63.2%
Final simplification68.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -4.4e+119) (not (<= (* x y) 5.5e+50))) (* x y) (* (* a b) -0.25)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -4.4e+119) || !((x * y) <= 5.5e+50)) {
tmp = x * y;
} else {
tmp = (a * b) * -0.25;
}
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) <= (-4.4d+119)) .or. (.not. ((x * y) <= 5.5d+50))) then
tmp = x * y
else
tmp = (a * b) * (-0.25d0)
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) <= -4.4e+119) || !((x * y) <= 5.5e+50)) {
tmp = x * y;
} else {
tmp = (a * b) * -0.25;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -4.4e+119) or not ((x * y) <= 5.5e+50): tmp = x * y else: tmp = (a * b) * -0.25 return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -4.4e+119) || !(Float64(x * y) <= 5.5e+50)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) * -0.25); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -4.4e+119) || ~(((x * y) <= 5.5e+50))) tmp = x * y; else tmp = (a * b) * -0.25; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -4.4e+119], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.5e+50]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.4 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 5.5 \cdot 10^{+50}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -4.4000000000000003e119 or 5.4999999999999998e50 < (*.f64 x y) Initial program 95.5%
Taylor expanded in z around 0 82.7%
Taylor expanded in c around 0 74.4%
Taylor expanded in x around inf 65.4%
if -4.4000000000000003e119 < (*.f64 x y) < 5.4999999999999998e50Initial program 99.3%
Taylor expanded in x around 0 97.3%
Taylor expanded in t around 0 66.4%
Taylor expanded in c around 0 42.4%
Final simplification52.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.15e+80) (not (<= (* x y) 1.12e+50))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.15e+80) || !((x * y) <= 1.12e+50)) {
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) <= (-1.15d+80)) .or. (.not. ((x * y) <= 1.12d+50))) 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) <= -1.15e+80) || !((x * y) <= 1.12e+50)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.15e+80) or not ((x * y) <= 1.12e+50): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.15e+80) || !(Float64(x * y) <= 1.12e+50)) 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) <= -1.15e+80) || ~(((x * y) <= 1.12e+50))) 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], -1.15e+80], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.12e+50]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+80} \lor \neg \left(x \cdot y \leq 1.12 \cdot 10^{+50}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.15000000000000002e80 or 1.1199999999999999e50 < (*.f64 x y) Initial program 95.7%
Taylor expanded in z around 0 82.4%
Taylor expanded in c around 0 74.4%
Taylor expanded in x around inf 64.1%
if -1.15000000000000002e80 < (*.f64 x y) < 1.1199999999999999e50Initial program 99.3%
Taylor expanded in c around inf 26.4%
Final simplification42.7%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* z (* t 0.0625)) (* x y)) (* a (/ b 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((z * (t * 0.0625)) + (x * y)) - (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 + (((z * (t * 0.0625d0)) + (x * y)) - (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 + (((z * (t * 0.0625)) + (x * y)) - (a * (b / 4.0)));
}
def code(x, y, z, t, a, b, c): return c + (((z * (t * 0.0625)) + (x * y)) - (a * (b / 4.0)))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(z * Float64(t * 0.0625)) + Float64(x * y)) - Float64(a * Float64(b / 4.0)))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((z * (t * 0.0625)) + (x * y)) - (a * (b / 4.0))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(z \cdot \left(t \cdot 0.0625\right) + x \cdot y\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 97.7%
associate-+l-97.7%
+-commutative97.7%
*-commutative97.7%
+-commutative97.7%
associate-+l-97.7%
fma-define98.5%
*-commutative98.5%
associate-/l*98.8%
associate-/l*98.8%
Simplified98.8%
fma-undefine98.0%
associate-*r/97.7%
+-commutative97.7%
associate-*r/98.0%
div-inv98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Final simplification98.0%
(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.7%
Final simplification97.7%
(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.7%
Taylor expanded in c around inf 18.9%
herbie shell --seed 2024185
(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))