
(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 t (/ z 16.0) (fma x y (- c (* b (/ a 4.0))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(t, (z / 16.0), fma(x, y, (c - (b * (a / 4.0)))));
}
function code(x, y, z, t, a, b, c) return fma(t, Float64(z / 16.0), fma(x, y, Float64(c - Float64(b * Float64(a / 4.0))))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(t * N[(z / 16.0), $MachinePrecision] + N[(x * y + N[(c - N[(b * N[(a / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Initial program 98.4%
associate-+l-98.4%
+-commutative98.4%
associate--l+98.4%
associate-*l/98.4%
*-commutative98.4%
fma-def99.2%
fma-neg99.2%
neg-sub099.2%
associate-+l-99.2%
neg-sub099.2%
+-commutative99.2%
unsub-neg99.2%
*-commutative99.2%
associate-*r/99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* b a) 0.25))))
(if (<= (* b a) -2e+54)
t_1
(if (<= (* b a) -4.0)
(+ c (* b (* a -0.25)))
(if (<= (* b a) 5e-85)
(+ (* 0.0625 (* t z)) (* x y))
(if (<= (* b a) 2e+116) (+ c (* t (/ z 16.0))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((b * a) * 0.25);
double tmp;
if ((b * a) <= -2e+54) {
tmp = t_1;
} else if ((b * a) <= -4.0) {
tmp = c + (b * (a * -0.25));
} else if ((b * a) <= 5e-85) {
tmp = (0.0625 * (t * z)) + (x * y);
} else if ((b * a) <= 2e+116) {
tmp = c + (t * (z / 16.0));
} 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) - ((b * a) * 0.25d0)
if ((b * a) <= (-2d+54)) then
tmp = t_1
else if ((b * a) <= (-4.0d0)) then
tmp = c + (b * (a * (-0.25d0)))
else if ((b * a) <= 5d-85) then
tmp = (0.0625d0 * (t * z)) + (x * y)
else if ((b * a) <= 2d+116) then
tmp = c + (t * (z / 16.0d0))
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) - ((b * a) * 0.25);
double tmp;
if ((b * a) <= -2e+54) {
tmp = t_1;
} else if ((b * a) <= -4.0) {
tmp = c + (b * (a * -0.25));
} else if ((b * a) <= 5e-85) {
tmp = (0.0625 * (t * z)) + (x * y);
} else if ((b * a) <= 2e+116) {
tmp = c + (t * (z / 16.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((b * a) * 0.25) tmp = 0 if (b * a) <= -2e+54: tmp = t_1 elif (b * a) <= -4.0: tmp = c + (b * (a * -0.25)) elif (b * a) <= 5e-85: tmp = (0.0625 * (t * z)) + (x * y) elif (b * a) <= 2e+116: tmp = c + (t * (z / 16.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)) tmp = 0.0 if (Float64(b * a) <= -2e+54) tmp = t_1; elseif (Float64(b * a) <= -4.0) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(b * a) <= 5e-85) tmp = Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y)); elseif (Float64(b * a) <= 2e+116) tmp = Float64(c + Float64(t * Float64(z / 16.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((b * a) * 0.25); tmp = 0.0; if ((b * a) <= -2e+54) tmp = t_1; elseif ((b * a) <= -4.0) tmp = c + (b * (a * -0.25)); elseif ((b * a) <= 5e-85) tmp = (0.0625 * (t * z)) + (x * y); elseif ((b * a) <= 2e+116) tmp = c + (t * (z / 16.0)); 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[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -2e+54], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -4.0], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 5e-85], N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+116], N[(c + N[(t * N[(z / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -4:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{-85}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right) + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+116}:\\
\;\;\;\;c + t \cdot \frac{z}{16}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000002e54 or 2.00000000000000003e116 < (*.f64 a b) Initial program 97.0%
Taylor expanded in z around 0 90.1%
Taylor expanded in c around 0 86.6%
if -2.0000000000000002e54 < (*.f64 a b) < -4Initial program 100.0%
Taylor expanded in a around inf 83.9%
*-commutative83.9%
*-commutative83.9%
associate-*r*83.9%
Simplified83.9%
if -4 < (*.f64 a b) < 5.0000000000000002e-85Initial program 99.1%
Taylor expanded in a around 0 94.5%
Taylor expanded in c around 0 76.9%
if 5.0000000000000002e-85 < (*.f64 a b) < 2.00000000000000003e116Initial program 99.9%
Taylor expanded in z around inf 76.1%
associate-*r*76.1%
metadata-eval76.1%
associate-/r/76.1%
associate-*l/76.0%
*-commutative76.0%
*-rgt-identity76.0%
associate-/r/76.1%
Simplified76.1%
Final simplification80.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))) (t_2 (* (* b a) 0.25)))
(if (<= (* b a) -5e+151)
(- (+ c t_1) t_2)
(if (or (<= (* b a) -4.0) (not (<= (* b a) 5e+102)))
(- (+ c (* x y)) t_2)
(+ c (+ t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double t_2 = (b * a) * 0.25;
double tmp;
if ((b * a) <= -5e+151) {
tmp = (c + t_1) - t_2;
} else if (((b * a) <= -4.0) || !((b * a) <= 5e+102)) {
tmp = (c + (x * y)) - t_2;
} else {
tmp = c + (t_1 + (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 = 0.0625d0 * (t * z)
t_2 = (b * a) * 0.25d0
if ((b * a) <= (-5d+151)) then
tmp = (c + t_1) - t_2
else if (((b * a) <= (-4.0d0)) .or. (.not. ((b * a) <= 5d+102))) then
tmp = (c + (x * y)) - t_2
else
tmp = c + (t_1 + (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 = 0.0625 * (t * z);
double t_2 = (b * a) * 0.25;
double tmp;
if ((b * a) <= -5e+151) {
tmp = (c + t_1) - t_2;
} else if (((b * a) <= -4.0) || !((b * a) <= 5e+102)) {
tmp = (c + (x * y)) - t_2;
} else {
tmp = c + (t_1 + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) t_2 = (b * a) * 0.25 tmp = 0 if (b * a) <= -5e+151: tmp = (c + t_1) - t_2 elif ((b * a) <= -4.0) or not ((b * a) <= 5e+102): tmp = (c + (x * y)) - t_2 else: tmp = c + (t_1 + (x * y)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) t_2 = Float64(Float64(b * a) * 0.25) tmp = 0.0 if (Float64(b * a) <= -5e+151) tmp = Float64(Float64(c + t_1) - t_2); elseif ((Float64(b * a) <= -4.0) || !(Float64(b * a) <= 5e+102)) tmp = Float64(Float64(c + Float64(x * y)) - t_2); else tmp = Float64(c + Float64(t_1 + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (t * z); t_2 = (b * a) * 0.25; tmp = 0.0; if ((b * a) <= -5e+151) tmp = (c + t_1) - t_2; elseif (((b * a) <= -4.0) || ~(((b * a) <= 5e+102))) tmp = (c + (x * y)) - t_2; else tmp = c + (t_1 + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5e+151], N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Or[LessEqual[N[(b * a), $MachinePrecision], -4.0], N[Not[LessEqual[N[(b * a), $MachinePrecision], 5e+102]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(c + N[(t$95$1 + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
t_2 := \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+151}:\\
\;\;\;\;\left(c + t_1\right) - t_2\\
\mathbf{elif}\;b \cdot a \leq -4 \lor \neg \left(b \cdot a \leq 5 \cdot 10^{+102}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;c + \left(t_1 + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000002e151Initial program 96.1%
Taylor expanded in x around 0 92.3%
if -5.0000000000000002e151 < (*.f64 a b) < -4 or 5e102 < (*.f64 a b) Initial program 98.4%
Taylor expanded in z around 0 96.7%
if -4 < (*.f64 a b) < 5e102Initial program 99.3%
Taylor expanded in a around 0 94.4%
Final simplification94.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* b (* a -0.25)))) (t_2 (+ c (* x y))))
(if (<= y -2.1e-29)
t_2
(if (<= y -2.1e-301)
t_1
(if (<= y 5.1e+36)
(+ c (* t (/ z 16.0)))
(if (or (<= y 2.9e+60) (and (not (<= y 5.9e+125)) (<= y 7.8e+180)))
t_1
t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double t_2 = c + (x * y);
double tmp;
if (y <= -2.1e-29) {
tmp = t_2;
} else if (y <= -2.1e-301) {
tmp = t_1;
} else if (y <= 5.1e+36) {
tmp = c + (t * (z / 16.0));
} else if ((y <= 2.9e+60) || (!(y <= 5.9e+125) && (y <= 7.8e+180))) {
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 + (b * (a * (-0.25d0)))
t_2 = c + (x * y)
if (y <= (-2.1d-29)) then
tmp = t_2
else if (y <= (-2.1d-301)) then
tmp = t_1
else if (y <= 5.1d+36) then
tmp = c + (t * (z / 16.0d0))
else if ((y <= 2.9d+60) .or. (.not. (y <= 5.9d+125)) .and. (y <= 7.8d+180)) 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 + (b * (a * -0.25));
double t_2 = c + (x * y);
double tmp;
if (y <= -2.1e-29) {
tmp = t_2;
} else if (y <= -2.1e-301) {
tmp = t_1;
} else if (y <= 5.1e+36) {
tmp = c + (t * (z / 16.0));
} else if ((y <= 2.9e+60) || (!(y <= 5.9e+125) && (y <= 7.8e+180))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (b * (a * -0.25)) t_2 = c + (x * y) tmp = 0 if y <= -2.1e-29: tmp = t_2 elif y <= -2.1e-301: tmp = t_1 elif y <= 5.1e+36: tmp = c + (t * (z / 16.0)) elif (y <= 2.9e+60) or (not (y <= 5.9e+125) and (y <= 7.8e+180)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(b * Float64(a * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (y <= -2.1e-29) tmp = t_2; elseif (y <= -2.1e-301) tmp = t_1; elseif (y <= 5.1e+36) tmp = Float64(c + Float64(t * Float64(z / 16.0))); elseif ((y <= 2.9e+60) || (!(y <= 5.9e+125) && (y <= 7.8e+180))) 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 + (b * (a * -0.25)); t_2 = c + (x * y); tmp = 0.0; if (y <= -2.1e-29) tmp = t_2; elseif (y <= -2.1e-301) tmp = t_1; elseif (y <= 5.1e+36) tmp = c + (t * (z / 16.0)); elseif ((y <= 2.9e+60) || (~((y <= 5.9e+125)) && (y <= 7.8e+180))) 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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e-29], t$95$2, If[LessEqual[y, -2.1e-301], t$95$1, If[LessEqual[y, 5.1e+36], N[(c + N[(t * N[(z / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 2.9e+60], And[N[Not[LessEqual[y, 5.9e+125]], $MachinePrecision], LessEqual[y, 7.8e+180]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+36}:\\
\;\;\;\;c + t \cdot \frac{z}{16}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+60} \lor \neg \left(y \leq 5.9 \cdot 10^{+125}\right) \land y \leq 7.8 \cdot 10^{+180}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.09999999999999989e-29 or 2.9e60 < y < 5.9000000000000001e125 or 7.8000000000000002e180 < y Initial program 97.1%
Taylor expanded in x around inf 66.7%
if -2.09999999999999989e-29 < y < -2.0999999999999999e-301 or 5.09999999999999973e36 < y < 2.9e60 or 5.9000000000000001e125 < y < 7.8000000000000002e180Initial program 98.7%
Taylor expanded in a around inf 67.4%
*-commutative67.4%
*-commutative67.4%
associate-*r*67.4%
Simplified67.4%
if -2.0999999999999999e-301 < y < 5.09999999999999973e36Initial program 100.0%
Taylor expanded in z around inf 66.7%
associate-*r*66.7%
metadata-eval66.7%
associate-/r/66.6%
associate-*l/66.6%
*-commutative66.6%
*-rgt-identity66.6%
associate-/r/66.7%
Simplified66.7%
Final simplification66.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -1e+176) (not (<= (* b a) 2e+116))) (- (* x y) (* (* b a) 0.25)) (+ c (+ (* 0.0625 (* t z)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -1e+176) || !((b * a) <= 2e+116)) {
tmp = (x * y) - ((b * a) * 0.25);
} else {
tmp = c + ((0.0625 * (t * z)) + (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 * a) <= (-1d+176)) .or. (.not. ((b * a) <= 2d+116))) then
tmp = (x * y) - ((b * a) * 0.25d0)
else
tmp = c + ((0.0625d0 * (t * z)) + (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 * a) <= -1e+176) || !((b * a) <= 2e+116)) {
tmp = (x * y) - ((b * a) * 0.25);
} else {
tmp = c + ((0.0625 * (t * z)) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -1e+176) or not ((b * a) <= 2e+116): tmp = (x * y) - ((b * a) * 0.25) else: tmp = c + ((0.0625 * (t * z)) + (x * y)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -1e+176) || !(Float64(b * a) <= 2e+116)) tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -1e+176) || ~(((b * a) <= 2e+116))) tmp = (x * y) - ((b * a) * 0.25); else tmp = c + ((0.0625 * (t * z)) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -1e+176], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+116]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+176} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+116}\right):\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1e176 or 2.00000000000000003e116 < (*.f64 a b) Initial program 96.1%
Taylor expanded in z around 0 93.6%
Taylor expanded in c around 0 92.8%
if -1e176 < (*.f64 a b) < 2.00000000000000003e116Initial program 99.4%
Taylor expanded in a around 0 90.6%
Final simplification91.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -4.0) (not (<= (* b a) 5e+102))) (- (+ c (* x y)) (* (* b a) 0.25)) (+ c (+ (* 0.0625 (* t z)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -4.0) || !((b * a) <= 5e+102)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((0.0625 * (t * z)) + (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 * a) <= (-4.0d0)) .or. (.not. ((b * a) <= 5d+102))) then
tmp = (c + (x * y)) - ((b * a) * 0.25d0)
else
tmp = c + ((0.0625d0 * (t * z)) + (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 * a) <= -4.0) || !((b * a) <= 5e+102)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((0.0625 * (t * z)) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -4.0) or not ((b * a) <= 5e+102): tmp = (c + (x * y)) - ((b * a) * 0.25) else: tmp = c + ((0.0625 * (t * z)) + (x * y)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -4.0) || !(Float64(b * a) <= 5e+102)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -4.0) || ~(((b * a) <= 5e+102))) tmp = (c + (x * y)) - ((b * a) * 0.25); else tmp = c + ((0.0625 * (t * z)) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -4.0], N[Not[LessEqual[N[(b * a), $MachinePrecision], 5e+102]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -4 \lor \neg \left(b \cdot a \leq 5 \cdot 10^{+102}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4 or 5e102 < (*.f64 a b) Initial program 97.3%
Taylor expanded in z around 0 90.4%
if -4 < (*.f64 a b) < 5e102Initial program 99.3%
Taylor expanded in a around 0 94.4%
Final simplification92.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) 0.25)) (t_2 (* 0.0625 (* t z))))
(if (<= (* b a) -2e+167)
(- t_2 t_1)
(if (<= (* b a) 2e+116) (+ c (+ t_2 (* x y))) (- (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * 0.25;
double t_2 = 0.0625 * (t * z);
double tmp;
if ((b * a) <= -2e+167) {
tmp = t_2 - t_1;
} else if ((b * a) <= 2e+116) {
tmp = c + (t_2 + (x * y));
} 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 = (b * a) * 0.25d0
t_2 = 0.0625d0 * (t * z)
if ((b * a) <= (-2d+167)) then
tmp = t_2 - t_1
else if ((b * a) <= 2d+116) then
tmp = c + (t_2 + (x * y))
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 = (b * a) * 0.25;
double t_2 = 0.0625 * (t * z);
double tmp;
if ((b * a) <= -2e+167) {
tmp = t_2 - t_1;
} else if ((b * a) <= 2e+116) {
tmp = c + (t_2 + (x * y));
} else {
tmp = (x * y) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * 0.25 t_2 = 0.0625 * (t * z) tmp = 0 if (b * a) <= -2e+167: tmp = t_2 - t_1 elif (b * a) <= 2e+116: tmp = c + (t_2 + (x * y)) else: tmp = (x * y) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * 0.25) t_2 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (Float64(b * a) <= -2e+167) tmp = Float64(t_2 - t_1); elseif (Float64(b * a) <= 2e+116) tmp = Float64(c + Float64(t_2 + Float64(x * y))); 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 = (b * a) * 0.25; t_2 = 0.0625 * (t * z); tmp = 0.0; if ((b * a) <= -2e+167) tmp = t_2 - t_1; elseif ((b * a) <= 2e+116) tmp = c + (t_2 + (x * y)); 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[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -2e+167], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+116], N[(c + N[(t$95$2 + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;b \cdot a \leq -2 \cdot 10^{+167}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+116}:\\
\;\;\;\;c + \left(t_2 + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e167Initial program 95.7%
Taylor expanded in x around 0 91.5%
Taylor expanded in c around 0 90.1%
if -2.0000000000000001e167 < (*.f64 a b) < 2.00000000000000003e116Initial program 99.4%
Taylor expanded in a around 0 91.0%
if 2.00000000000000003e116 < (*.f64 a b) Initial program 96.9%
Taylor expanded in z around 0 100.0%
Taylor expanded in c around 0 100.0%
Final simplification92.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= y -6.5e-139)
(* x y)
(if (<= y -5e-288)
t_1
(if (<= y 2.15e+36)
(* 0.0625 (* t z))
(if (or (<= y 1.5e+57) (and (not (<= y 3.9e+127)) (<= y 4.8e+181)))
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 (y <= -6.5e-139) {
tmp = x * y;
} else if (y <= -5e-288) {
tmp = t_1;
} else if (y <= 2.15e+36) {
tmp = 0.0625 * (t * z);
} else if ((y <= 1.5e+57) || (!(y <= 3.9e+127) && (y <= 4.8e+181))) {
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 (y <= (-6.5d-139)) then
tmp = x * y
else if (y <= (-5d-288)) then
tmp = t_1
else if (y <= 2.15d+36) then
tmp = 0.0625d0 * (t * z)
else if ((y <= 1.5d+57) .or. (.not. (y <= 3.9d+127)) .and. (y <= 4.8d+181)) 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 (y <= -6.5e-139) {
tmp = x * y;
} else if (y <= -5e-288) {
tmp = t_1;
} else if (y <= 2.15e+36) {
tmp = 0.0625 * (t * z);
} else if ((y <= 1.5e+57) || (!(y <= 3.9e+127) && (y <= 4.8e+181))) {
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 y <= -6.5e-139: tmp = x * y elif y <= -5e-288: tmp = t_1 elif y <= 2.15e+36: tmp = 0.0625 * (t * z) elif (y <= 1.5e+57) or (not (y <= 3.9e+127) and (y <= 4.8e+181)): 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 (y <= -6.5e-139) tmp = Float64(x * y); elseif (y <= -5e-288) tmp = t_1; elseif (y <= 2.15e+36) tmp = Float64(0.0625 * Float64(t * z)); elseif ((y <= 1.5e+57) || (!(y <= 3.9e+127) && (y <= 4.8e+181))) 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 (y <= -6.5e-139) tmp = x * y; elseif (y <= -5e-288) tmp = t_1; elseif (y <= 2.15e+36) tmp = 0.0625 * (t * z); elseif ((y <= 1.5e+57) || (~((y <= 3.9e+127)) && (y <= 4.8e+181))) 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[y, -6.5e-139], N[(x * y), $MachinePrecision], If[LessEqual[y, -5e-288], t$95$1, If[LessEqual[y, 2.15e+36], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.5e+57], And[N[Not[LessEqual[y, 3.9e+127]], $MachinePrecision], LessEqual[y, 4.8e+181]]], 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}\;y \leq -6.5 \cdot 10^{-139}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-288}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+36}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+57} \lor \neg \left(y \leq 3.9 \cdot 10^{+127}\right) \land y \leq 4.8 \cdot 10^{+181}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -6.5e-139 or 1.5e57 < y < 3.89999999999999981e127 or 4.80000000000000004e181 < y Initial program 97.6%
Taylor expanded in z around 0 81.4%
Taylor expanded in y around inf 46.2%
if -6.5e-139 < y < -5.00000000000000011e-288 or 2.15000000000000002e36 < y < 1.5e57 or 3.89999999999999981e127 < y < 4.80000000000000004e181Initial program 98.3%
Taylor expanded in z around 0 83.9%
Taylor expanded in a around inf 54.1%
associate-*r*54.1%
*-commutative54.1%
*-commutative54.1%
Simplified54.1%
if -5.00000000000000011e-288 < y < 2.15000000000000002e36Initial program 100.0%
Taylor expanded in z around inf 68.5%
associate-*r*68.5%
metadata-eval68.5%
associate-/r/68.4%
associate-*l/68.4%
*-commutative68.4%
*-rgt-identity68.4%
associate-/r/68.5%
Simplified68.5%
Taylor expanded in z around inf 47.0%
Final simplification48.2%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 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 + ((((t * z) / 16.0d0) + (x * y)) - ((b * a) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\right)
\end{array}
Initial program 98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* b (* a -0.25))))
(if (<= a -5.7e+156)
t_2
(if (<= a 9.5e-239)
t_1
(if (<= a 8.5e-124) (* 0.0625 (* t z)) (if (<= a 1.05e+27) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = b * (a * -0.25);
double tmp;
if (a <= -5.7e+156) {
tmp = t_2;
} else if (a <= 9.5e-239) {
tmp = t_1;
} else if (a <= 8.5e-124) {
tmp = 0.0625 * (t * z);
} else if (a <= 1.05e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = b * (a * (-0.25d0))
if (a <= (-5.7d+156)) then
tmp = t_2
else if (a <= 9.5d-239) then
tmp = t_1
else if (a <= 8.5d-124) then
tmp = 0.0625d0 * (t * z)
else if (a <= 1.05d+27) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = b * (a * -0.25);
double tmp;
if (a <= -5.7e+156) {
tmp = t_2;
} else if (a <= 9.5e-239) {
tmp = t_1;
} else if (a <= 8.5e-124) {
tmp = 0.0625 * (t * z);
} else if (a <= 1.05e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = b * (a * -0.25) tmp = 0 if a <= -5.7e+156: tmp = t_2 elif a <= 9.5e-239: tmp = t_1 elif a <= 8.5e-124: tmp = 0.0625 * (t * z) elif a <= 1.05e+27: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (a <= -5.7e+156) tmp = t_2; elseif (a <= 9.5e-239) tmp = t_1; elseif (a <= 8.5e-124) tmp = Float64(0.0625 * Float64(t * z)); elseif (a <= 1.05e+27) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = b * (a * -0.25); tmp = 0.0; if (a <= -5.7e+156) tmp = t_2; elseif (a <= 9.5e-239) tmp = t_1; elseif (a <= 8.5e-124) tmp = 0.0625 * (t * z); elseif (a <= 1.05e+27) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.7e+156], t$95$2, If[LessEqual[a, 9.5e-239], t$95$1, If[LessEqual[a, 8.5e-124], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+27], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;a \leq -5.7 \cdot 10^{+156}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-124}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -5.69999999999999998e156 or 1.04999999999999997e27 < a Initial program 97.6%
Taylor expanded in z around 0 86.0%
Taylor expanded in a around inf 67.4%
associate-*r*67.4%
*-commutative67.4%
*-commutative67.4%
Simplified67.4%
if -5.69999999999999998e156 < a < 9.4999999999999992e-239 or 8.5000000000000002e-124 < a < 1.04999999999999997e27Initial program 98.6%
Taylor expanded in x around inf 58.3%
if 9.4999999999999992e-239 < a < 8.5000000000000002e-124Initial program 99.9%
Taylor expanded in z around inf 62.2%
associate-*r*62.2%
metadata-eval62.2%
associate-/r/61.9%
associate-*l/62.0%
*-commutative62.0%
*-rgt-identity62.0%
associate-/r/62.2%
Simplified62.2%
Taylor expanded in z around inf 47.1%
Final simplification60.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* b (* a -0.25)))))
(if (<= a -2.2e+97)
t_1
(if (<= a 4.3e-239)
(+ c (* x y))
(if (<= a 3.15e-180) (* 0.0625 (* t z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double tmp;
if (a <= -2.2e+97) {
tmp = t_1;
} else if (a <= 4.3e-239) {
tmp = c + (x * y);
} else if (a <= 3.15e-180) {
tmp = 0.0625 * (t * z);
} 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 = c + (b * (a * (-0.25d0)))
if (a <= (-2.2d+97)) then
tmp = t_1
else if (a <= 4.3d-239) then
tmp = c + (x * y)
else if (a <= 3.15d-180) then
tmp = 0.0625d0 * (t * z)
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 = c + (b * (a * -0.25));
double tmp;
if (a <= -2.2e+97) {
tmp = t_1;
} else if (a <= 4.3e-239) {
tmp = c + (x * y);
} else if (a <= 3.15e-180) {
tmp = 0.0625 * (t * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (b * (a * -0.25)) tmp = 0 if a <= -2.2e+97: tmp = t_1 elif a <= 4.3e-239: tmp = c + (x * y) elif a <= 3.15e-180: tmp = 0.0625 * (t * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(b * Float64(a * -0.25))) tmp = 0.0 if (a <= -2.2e+97) tmp = t_1; elseif (a <= 4.3e-239) tmp = Float64(c + Float64(x * y)); elseif (a <= 3.15e-180) tmp = Float64(0.0625 * Float64(t * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (b * (a * -0.25)); tmp = 0.0; if (a <= -2.2e+97) tmp = t_1; elseif (a <= 4.3e-239) tmp = c + (x * y); elseif (a <= 3.15e-180) tmp = 0.0625 * (t * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.2e+97], t$95$1, If[LessEqual[a, 4.3e-239], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.15e-180], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;a \leq -2.2 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 4.3 \cdot 10^{-239}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \leq 3.15 \cdot 10^{-180}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -2.2000000000000001e97 or 3.1499999999999998e-180 < a Initial program 98.5%
Taylor expanded in a around inf 63.2%
*-commutative63.2%
*-commutative63.2%
associate-*r*63.2%
Simplified63.2%
if -2.2000000000000001e97 < a < 4.3e-239Initial program 98.1%
Taylor expanded in x around inf 62.1%
if 4.3e-239 < a < 3.1499999999999998e-180Initial program 99.9%
Taylor expanded in z around inf 63.3%
associate-*r*63.3%
metadata-eval63.3%
associate-/r/63.1%
associate-*l/63.2%
*-commutative63.2%
*-rgt-identity63.2%
associate-/r/63.3%
Simplified63.3%
Taylor expanded in z around inf 50.3%
Final simplification61.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -1.3e-123) (not (<= b 8.5e+76))) (+ c (* b (* a -0.25))) (+ (* 0.0625 (* t z)) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -1.3e-123) || !(b <= 8.5e+76)) {
tmp = c + (b * (a * -0.25));
} else {
tmp = (0.0625 * (t * z)) + (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 <= (-1.3d-123)) .or. (.not. (b <= 8.5d+76))) then
tmp = c + (b * (a * (-0.25d0)))
else
tmp = (0.0625d0 * (t * z)) + (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 <= -1.3e-123) || !(b <= 8.5e+76)) {
tmp = c + (b * (a * -0.25));
} else {
tmp = (0.0625 * (t * z)) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -1.3e-123) or not (b <= 8.5e+76): tmp = c + (b * (a * -0.25)) else: tmp = (0.0625 * (t * z)) + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -1.3e-123) || !(b <= 8.5e+76)) tmp = Float64(c + Float64(b * Float64(a * -0.25))); else tmp = Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -1.3e-123) || ~((b <= 8.5e+76))) tmp = c + (b * (a * -0.25)); else tmp = (0.0625 * (t * z)) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -1.3e-123], N[Not[LessEqual[b, 8.5e+76]], $MachinePrecision]], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{-123} \lor \neg \left(b \leq 8.5 \cdot 10^{+76}\right):\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right) + x \cdot y\\
\end{array}
\end{array}
if b < -1.29999999999999998e-123 or 8.49999999999999992e76 < b Initial program 97.9%
Taylor expanded in a around inf 61.6%
*-commutative61.6%
*-commutative61.6%
associate-*r*61.6%
Simplified61.6%
if -1.29999999999999998e-123 < b < 8.49999999999999992e76Initial program 99.1%
Taylor expanded in a around 0 85.4%
Taylor expanded in c around 0 65.4%
Final simplification63.2%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -2.7e-167) (* x y) (if (<= y 2.4e+52) (* 0.0625 (* t z)) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -2.7e-167) {
tmp = x * y;
} else if (y <= 2.4e+52) {
tmp = 0.0625 * (t * z);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (y <= (-2.7d-167)) then
tmp = x * y
else if (y <= 2.4d+52) then
tmp = 0.0625d0 * (t * z)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -2.7e-167) {
tmp = x * y;
} else if (y <= 2.4e+52) {
tmp = 0.0625 * (t * z);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -2.7e-167: tmp = x * y elif y <= 2.4e+52: tmp = 0.0625 * (t * z) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -2.7e-167) tmp = Float64(x * y); elseif (y <= 2.4e+52) tmp = Float64(0.0625 * Float64(t * z)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (y <= -2.7e-167) tmp = x * y; elseif (y <= 2.4e+52) tmp = 0.0625 * (t * z); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -2.7e-167], N[(x * y), $MachinePrecision], If[LessEqual[y, 2.4e+52], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-167}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+52}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.7000000000000001e-167 or 2.4e52 < y Initial program 98.0%
Taylor expanded in z around 0 82.8%
Taylor expanded in y around inf 45.0%
if -2.7000000000000001e-167 < y < 2.4e52Initial program 99.0%
Taylor expanded in z around inf 60.6%
associate-*r*60.6%
metadata-eval60.6%
associate-/r/60.6%
associate-*l/60.5%
*-commutative60.5%
*-rgt-identity60.5%
associate-/r/60.6%
Simplified60.6%
Taylor expanded in z around inf 39.1%
Final simplification42.5%
(FPCore (x y z t a b c) :precision binary64 (if (<= c -3.75e+177) c (if (<= c 1.7e+128) (* x y) c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= -3.75e+177) {
tmp = c;
} else if (c <= 1.7e+128) {
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 (c <= (-3.75d+177)) then
tmp = c
else if (c <= 1.7d+128) 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 (c <= -3.75e+177) {
tmp = c;
} else if (c <= 1.7e+128) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if c <= -3.75e+177: tmp = c elif c <= 1.7e+128: tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= -3.75e+177) tmp = c; elseif (c <= 1.7e+128) 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 (c <= -3.75e+177) tmp = c; elseif (c <= 1.7e+128) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -3.75e+177], c, If[LessEqual[c, 1.7e+128], N[(x * y), $MachinePrecision], c]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.75 \cdot 10^{+177}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{+128}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if c < -3.7500000000000002e177 or 1.6999999999999999e128 < c Initial program 98.5%
Taylor expanded in c around inf 59.2%
if -3.7500000000000002e177 < c < 1.6999999999999999e128Initial program 98.4%
Taylor expanded in z around 0 70.9%
Taylor expanded in y around inf 34.9%
Final simplification41.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 98.4%
Taylor expanded in c around inf 20.8%
Final simplification20.8%
herbie shell --seed 2023182
(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))