
(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 12 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 96.9%
associate--l+96.9%
fma-define99.2%
associate-/l*99.2%
fma-neg99.2%
distribute-neg-frac299.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY) (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))) (+ c (- (* 0.0625 (* z t)) (* (* 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) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
tmp = c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
} else {
tmp = c + ((0.0625 * (z * t)) - ((a * b) * 0.25));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf) tmp = Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))); else tmp = Float64(c + Float64(Float64(0.0625 * Float64(z * t)) - Float64(Float64(a * b) * 0.25))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], 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], N[(c + N[(N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-+l-100.0%
fma-define100.0%
*-commutative100.0%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in x around 0 75.0%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (+ (* x y) (* 0.0625 (* z t)))))
(t_2 (+ c (- (* x y) (* (* a b) 0.25)))))
(if (<= (* a b) -2e+105)
t_2
(if (<= (* a b) 1e+21)
t_1
(if (<= (* a b) 5e+211)
t_2
(if (<= (* a b) 2e+247) t_1 (* a (* b -0.25))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + ((x * y) + (0.0625 * (z * t)));
double t_2 = c + ((x * y) - ((a * b) * 0.25));
double tmp;
if ((a * b) <= -2e+105) {
tmp = t_2;
} else if ((a * b) <= 1e+21) {
tmp = t_1;
} else if ((a * b) <= 5e+211) {
tmp = t_2;
} else if ((a * b) <= 2e+247) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + ((x * y) + (0.0625d0 * (z * t)))
t_2 = c + ((x * y) - ((a * b) * 0.25d0))
if ((a * b) <= (-2d+105)) then
tmp = t_2
else if ((a * b) <= 1d+21) then
tmp = t_1
else if ((a * b) <= 5d+211) then
tmp = t_2
else if ((a * b) <= 2d+247) then
tmp = t_1
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 t_1 = c + ((x * y) + (0.0625 * (z * t)));
double t_2 = c + ((x * y) - ((a * b) * 0.25));
double tmp;
if ((a * b) <= -2e+105) {
tmp = t_2;
} else if ((a * b) <= 1e+21) {
tmp = t_1;
} else if ((a * b) <= 5e+211) {
tmp = t_2;
} else if ((a * b) <= 2e+247) {
tmp = t_1;
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + ((x * y) + (0.0625 * (z * t))) t_2 = c + ((x * y) - ((a * b) * 0.25)) tmp = 0 if (a * b) <= -2e+105: tmp = t_2 elif (a * b) <= 1e+21: tmp = t_1 elif (a * b) <= 5e+211: tmp = t_2 elif (a * b) <= 2e+247: tmp = t_1 else: tmp = a * (b * -0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))) t_2 = Float64(c + Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))) tmp = 0.0 if (Float64(a * b) <= -2e+105) tmp = t_2; elseif (Float64(a * b) <= 1e+21) tmp = t_1; elseif (Float64(a * b) <= 5e+211) tmp = t_2; elseif (Float64(a * b) <= 2e+247) tmp = t_1; else tmp = Float64(a * Float64(b * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + ((x * y) + (0.0625 * (z * t))); t_2 = c + ((x * y) - ((a * b) * 0.25)); tmp = 0.0; if ((a * b) <= -2e+105) tmp = t_2; elseif ((a * b) <= 1e+21) tmp = t_1; elseif ((a * b) <= 5e+211) tmp = t_2; elseif ((a * b) <= 2e+247) tmp = t_1; else tmp = a * (b * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+105], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 1e+21], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5e+211], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2e+247], t$95$1, N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
t_2 := c + \left(x \cdot y - \left(a \cdot b\right) \cdot 0.25\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+105}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+211}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+247}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.9999999999999999e105 or 1e21 < (*.f64 a b) < 4.9999999999999995e211Initial program 96.0%
Taylor expanded in z around 0 89.2%
if -1.9999999999999999e105 < (*.f64 a b) < 1e21 or 4.9999999999999995e211 < (*.f64 a b) < 1.9999999999999999e247Initial program 99.3%
Taylor expanded in a around 0 96.2%
if 1.9999999999999999e247 < (*.f64 a b) Initial program 84.0%
Taylor expanded in a around inf 92.4%
*-commutative92.4%
associate-*r*92.4%
Simplified92.4%
Taylor expanded in a around inf 92.4%
*-commutative92.4%
associate-*r*92.4%
*-commutative92.4%
Simplified92.4%
Final simplification93.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
(if (<= t_1 INFINITY)
(+ c t_1)
(+ c (- (* 0.0625 (* z t)) (* (* a b) 0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + ((0.0625 * (z * t)) - ((a * b) * 0.25));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + ((0.0625 * (z * t)) - ((a * b) * 0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + ((0.0625 * (z * t)) - ((a * b) * 0.25)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(Float64(0.0625 * Float64(z * t)) - Float64(Float64(a * b) * 0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + ((0.0625 * (z * t)) - ((a * b) * 0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in x around 0 75.0%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= a -3.5e+163)
t_1
(if (<= a -4.95e+95)
c
(if (or (<= a -1.8e+95)
(and (not (<= a -3.5e+64))
(or (<= a -3.1e+23) (not (<= a 2.2e-25)))))
t_1
(* z (* t 0.0625)))))))
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 <= -3.5e+163) {
tmp = t_1;
} else if (a <= -4.95e+95) {
tmp = c;
} else if ((a <= -1.8e+95) || (!(a <= -3.5e+64) && ((a <= -3.1e+23) || !(a <= 2.2e-25)))) {
tmp = t_1;
} else {
tmp = z * (t * 0.0625);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
if (a <= (-3.5d+163)) then
tmp = t_1
else if (a <= (-4.95d+95)) then
tmp = c
else if ((a <= (-1.8d+95)) .or. (.not. (a <= (-3.5d+64))) .and. (a <= (-3.1d+23)) .or. (.not. (a <= 2.2d-25))) then
tmp = t_1
else
tmp = z * (t * 0.0625d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if (a <= -3.5e+163) {
tmp = t_1;
} else if (a <= -4.95e+95) {
tmp = c;
} else if ((a <= -1.8e+95) || (!(a <= -3.5e+64) && ((a <= -3.1e+23) || !(a <= 2.2e-25)))) {
tmp = t_1;
} else {
tmp = z * (t * 0.0625);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if a <= -3.5e+163: tmp = t_1 elif a <= -4.95e+95: tmp = c elif (a <= -1.8e+95) or (not (a <= -3.5e+64) and ((a <= -3.1e+23) or not (a <= 2.2e-25))): tmp = t_1 else: tmp = z * (t * 0.0625) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (a <= -3.5e+163) tmp = t_1; elseif (a <= -4.95e+95) tmp = c; elseif ((a <= -1.8e+95) || (!(a <= -3.5e+64) && ((a <= -3.1e+23) || !(a <= 2.2e-25)))) tmp = t_1; else tmp = Float64(z * Float64(t * 0.0625)); 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 <= -3.5e+163) tmp = t_1; elseif (a <= -4.95e+95) tmp = c; elseif ((a <= -1.8e+95) || (~((a <= -3.5e+64)) && ((a <= -3.1e+23) || ~((a <= 2.2e-25))))) tmp = t_1; else tmp = z * (t * 0.0625); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.5e+163], t$95$1, If[LessEqual[a, -4.95e+95], c, If[Or[LessEqual[a, -1.8e+95], And[N[Not[LessEqual[a, -3.5e+64]], $MachinePrecision], Or[LessEqual[a, -3.1e+23], N[Not[LessEqual[a, 2.2e-25]], $MachinePrecision]]]], t$95$1, N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \leq -3.5 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.95 \cdot 10^{+95}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \leq -1.8 \cdot 10^{+95} \lor \neg \left(a \leq -3.5 \cdot 10^{+64}\right) \land \left(a \leq -3.1 \cdot 10^{+23} \lor \neg \left(a \leq 2.2 \cdot 10^{-25}\right)\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if a < -3.5000000000000003e163 or -4.9499999999999998e95 < a < -1.79999999999999989e95 or -3.4999999999999999e64 < a < -3.09999999999999971e23 or 2.2000000000000002e-25 < a Initial program 94.5%
Taylor expanded in a around inf 62.9%
*-commutative62.9%
associate-*r*62.9%
Simplified62.9%
Taylor expanded in a around inf 51.1%
*-commutative51.1%
associate-*r*51.1%
*-commutative51.1%
Simplified51.1%
if -3.5000000000000003e163 < a < -4.9499999999999998e95Initial program 94.0%
Taylor expanded in z around inf 48.3%
*-commutative48.3%
*-commutative48.3%
associate-*r*48.3%
*-commutative48.3%
Simplified48.3%
Taylor expanded in z around 0 13.7%
if -1.79999999999999989e95 < a < -3.4999999999999999e64 or -3.09999999999999971e23 < a < 2.2000000000000002e-25Initial program 99.2%
Taylor expanded in z around inf 50.7%
*-commutative50.7%
*-commutative50.7%
associate-*r*50.7%
*-commutative50.7%
Simplified50.7%
Taylor expanded in z around inf 27.2%
associate-*r*27.2%
*-commutative27.2%
Simplified27.2%
Final simplification36.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -7.4e+229)
t_2
(if (<= (* x y) -3.5e-86)
t_1
(if (<= (* x y) -2.8e-248)
(* z (* t 0.0625))
(if (<= (* x y) 3.15e+128) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -7.4e+229) {
tmp = t_2;
} else if ((x * y) <= -3.5e-86) {
tmp = t_1;
} else if ((x * y) <= -2.8e-248) {
tmp = z * (t * 0.0625);
} else if ((x * y) <= 3.15e+128) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-7.4d+229)) then
tmp = t_2
else if ((x * y) <= (-3.5d-86)) then
tmp = t_1
else if ((x * y) <= (-2.8d-248)) then
tmp = z * (t * 0.0625d0)
else if ((x * y) <= 3.15d+128) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -7.4e+229) {
tmp = t_2;
} else if ((x * y) <= -3.5e-86) {
tmp = t_1;
} else if ((x * y) <= -2.8e-248) {
tmp = z * (t * 0.0625);
} else if ((x * y) <= 3.15e+128) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -7.4e+229: tmp = t_2 elif (x * y) <= -3.5e-86: tmp = t_1 elif (x * y) <= -2.8e-248: tmp = z * (t * 0.0625) elif (x * y) <= 3.15e+128: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -7.4e+229) tmp = t_2; elseif (Float64(x * y) <= -3.5e-86) tmp = t_1; elseif (Float64(x * y) <= -2.8e-248) tmp = Float64(z * Float64(t * 0.0625)); elseif (Float64(x * y) <= 3.15e+128) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -7.4e+229) tmp = t_2; elseif ((x * y) <= -3.5e-86) tmp = t_1; elseif ((x * y) <= -2.8e-248) tmp = z * (t * 0.0625); elseif ((x * y) <= 3.15e+128) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7.4e+229], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -3.5e-86], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-248], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.15e+128], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -7.4 \cdot 10^{+229}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-248}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 3.15 \cdot 10^{+128}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -7.40000000000000005e229 or 3.1499999999999999e128 < (*.f64 x y) Initial program 90.2%
Taylor expanded in x around inf 84.3%
if -7.40000000000000005e229 < (*.f64 x y) < -3.50000000000000021e-86 or -2.8000000000000001e-248 < (*.f64 x y) < 3.1499999999999999e128Initial program 100.0%
Taylor expanded in a around inf 61.1%
*-commutative61.1%
associate-*r*61.1%
Simplified61.1%
if -3.50000000000000021e-86 < (*.f64 x y) < -2.8000000000000001e-248Initial program 100.0%
Taylor expanded in z around inf 79.8%
*-commutative79.8%
*-commutative79.8%
associate-*r*79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in z around inf 68.6%
associate-*r*68.6%
*-commutative68.6%
Simplified68.6%
Final simplification68.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -8e+229)
t_2
(if (<= (* x y) -2.4e+46)
t_1
(if (<= (* x y) -2.15e-248)
(+ c (* z (* t 0.0625)))
(if (<= (* x y) 2.06e+129) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -8e+229) {
tmp = t_2;
} else if ((x * y) <= -2.4e+46) {
tmp = t_1;
} else if ((x * y) <= -2.15e-248) {
tmp = c + (z * (t * 0.0625));
} else if ((x * y) <= 2.06e+129) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-8d+229)) then
tmp = t_2
else if ((x * y) <= (-2.4d+46)) then
tmp = t_1
else if ((x * y) <= (-2.15d-248)) then
tmp = c + (z * (t * 0.0625d0))
else if ((x * y) <= 2.06d+129) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -8e+229) {
tmp = t_2;
} else if ((x * y) <= -2.4e+46) {
tmp = t_1;
} else if ((x * y) <= -2.15e-248) {
tmp = c + (z * (t * 0.0625));
} else if ((x * y) <= 2.06e+129) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -8e+229: tmp = t_2 elif (x * y) <= -2.4e+46: tmp = t_1 elif (x * y) <= -2.15e-248: tmp = c + (z * (t * 0.0625)) elif (x * y) <= 2.06e+129: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -8e+229) tmp = t_2; elseif (Float64(x * y) <= -2.4e+46) tmp = t_1; elseif (Float64(x * y) <= -2.15e-248) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); elseif (Float64(x * y) <= 2.06e+129) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -8e+229) tmp = t_2; elseif ((x * y) <= -2.4e+46) tmp = t_1; elseif ((x * y) <= -2.15e-248) tmp = c + (z * (t * 0.0625)); elseif ((x * y) <= 2.06e+129) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8e+229], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.4e+46], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.15e-248], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.06e+129], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -8 \cdot 10^{+229}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -2.4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.15 \cdot 10^{-248}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 2.06 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -7.9999999999999999e229 or 2.06e129 < (*.f64 x y) Initial program 90.2%
Taylor expanded in x around inf 84.3%
if -7.9999999999999999e229 < (*.f64 x y) < -2.40000000000000008e46 or -2.1500000000000002e-248 < (*.f64 x y) < 2.06e129Initial program 100.0%
Taylor expanded in a around inf 61.7%
*-commutative61.7%
associate-*r*61.7%
Simplified61.7%
if -2.40000000000000008e46 < (*.f64 x y) < -2.1500000000000002e-248Initial program 100.0%
Taylor expanded in z around inf 81.9%
*-commutative81.9%
*-commutative81.9%
associate-*r*81.9%
*-commutative81.9%
Simplified81.9%
Final simplification71.9%
(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) -2e+105)
(+ c (- (* x y) t_1))
(if (<= (* a b) 2e+125) (+ c (+ (* x y) t_2)) (+ c (- t_2 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) <= -2e+105) {
tmp = c + ((x * y) - t_1);
} else if ((a * b) <= 2e+125) {
tmp = c + ((x * y) + t_2);
} else {
tmp = c + (t_2 - 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) <= (-2d+105)) then
tmp = c + ((x * y) - t_1)
else if ((a * b) <= 2d+125) then
tmp = c + ((x * y) + t_2)
else
tmp = c + (t_2 - 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) <= -2e+105) {
tmp = c + ((x * y) - t_1);
} else if ((a * b) <= 2e+125) {
tmp = c + ((x * y) + t_2);
} else {
tmp = c + (t_2 - 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) <= -2e+105: tmp = c + ((x * y) - t_1) elif (a * b) <= 2e+125: tmp = c + ((x * y) + t_2) else: tmp = c + (t_2 - 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) <= -2e+105) tmp = Float64(c + Float64(Float64(x * y) - t_1)); elseif (Float64(a * b) <= 2e+125) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(c + Float64(t_2 - 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) <= -2e+105) tmp = c + ((x * y) - t_1); elseif ((a * b) <= 2e+125) tmp = c + ((x * y) + t_2); else tmp = c + (t_2 - 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], -2e+105], N[(c + N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+125], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(c + N[(t$95$2 - t$95$1), $MachinePrecision]), $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 -2 \cdot 10^{+105}:\\
\;\;\;\;c + \left(x \cdot y - t\_1\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+125}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(t\_2 - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.9999999999999999e105Initial program 95.1%
Taylor expanded in z around 0 91.9%
if -1.9999999999999999e105 < (*.f64 a b) < 1.9999999999999998e125Initial program 99.4%
Taylor expanded in a around 0 94.6%
if 1.9999999999999998e125 < (*.f64 a b) Initial program 89.8%
Taylor expanded in x around 0 88.3%
Final simplification93.0%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= b -6.4e+34)
(and (not (<= b 7.5e+74))
(or (<= b 3.8e+118) (not (<= b 2.05e+178)))))
(* 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 ((b <= -6.4e+34) || (!(b <= 7.5e+74) && ((b <= 3.8e+118) || !(b <= 2.05e+178)))) {
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 ((b <= (-6.4d+34)) .or. (.not. (b <= 7.5d+74)) .and. (b <= 3.8d+118) .or. (.not. (b <= 2.05d+178))) 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 ((b <= -6.4e+34) || (!(b <= 7.5e+74) && ((b <= 3.8e+118) || !(b <= 2.05e+178)))) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -6.4e+34) or (not (b <= 7.5e+74) and ((b <= 3.8e+118) or not (b <= 2.05e+178))): 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 ((b <= -6.4e+34) || (!(b <= 7.5e+74) && ((b <= 3.8e+118) || !(b <= 2.05e+178)))) tmp = Float64(a * Float64(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 ((b <= -6.4e+34) || (~((b <= 7.5e+74)) && ((b <= 3.8e+118) || ~((b <= 2.05e+178))))) 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[b, -6.4e+34], And[N[Not[LessEqual[b, 7.5e+74]], $MachinePrecision], Or[LessEqual[b, 3.8e+118], N[Not[LessEqual[b, 2.05e+178]], $MachinePrecision]]]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{+34} \lor \neg \left(b \leq 7.5 \cdot 10^{+74}\right) \land \left(b \leq 3.8 \cdot 10^{+118} \lor \neg \left(b \leq 2.05 \cdot 10^{+178}\right)\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if b < -6.3999999999999997e34 or 7.5e74 < b < 3.80000000000000016e118 or 2.04999999999999998e178 < b Initial program 93.0%
Taylor expanded in a around inf 69.8%
*-commutative69.8%
associate-*r*69.8%
Simplified69.8%
Taylor expanded in a around inf 55.1%
*-commutative55.1%
associate-*r*55.1%
*-commutative55.1%
Simplified55.1%
if -6.3999999999999997e34 < b < 7.5e74 or 3.80000000000000016e118 < b < 2.04999999999999998e178Initial program 99.3%
Taylor expanded in x around inf 61.1%
Final simplification58.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -1e+24) (not (<= b 2e+179))) (+ c (* 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 ((b <= -1e+24) || !(b <= 2e+179)) {
tmp = c + (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 ((b <= (-1d+24)) .or. (.not. (b <= 2d+179))) then
tmp = c + (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 ((b <= -1e+24) || !(b <= 2e+179)) {
tmp = c + (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 (b <= -1e+24) or not (b <= 2e+179): tmp = c + (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 ((b <= -1e+24) || !(b <= 2e+179)) tmp = Float64(c + Float64(a * Float64(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 ((b <= -1e+24) || ~((b <= 2e+179))) tmp = c + (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[b, -1e+24], N[Not[LessEqual[b, 2e+179]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $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}\;b \leq -1 \cdot 10^{+24} \lor \neg \left(b \leq 2 \cdot 10^{+179}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if b < -9.9999999999999998e23 or 1.99999999999999996e179 < b Initial program 93.3%
Taylor expanded in a around inf 74.0%
*-commutative74.0%
associate-*r*74.0%
Simplified74.0%
if -9.9999999999999998e23 < b < 1.99999999999999996e179Initial program 98.8%
Taylor expanded in a around 0 87.4%
Final simplification82.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -2e-84) (not (<= b 8.8e+64))) (* a (* b -0.25)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -2e-84) || !(b <= 8.8e+64)) {
tmp = a * (b * -0.25);
} 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 ((b <= (-2d-84)) .or. (.not. (b <= 8.8d+64))) then
tmp = a * (b * (-0.25d0))
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 ((b <= -2e-84) || !(b <= 8.8e+64)) {
tmp = a * (b * -0.25);
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -2e-84) or not (b <= 8.8e+64): tmp = a * (b * -0.25) else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -2e-84) || !(b <= 8.8e+64)) tmp = Float64(a * Float64(b * -0.25)); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -2e-84) || ~((b <= 8.8e+64))) tmp = a * (b * -0.25); else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -2e-84], N[Not[LessEqual[b, 8.8e+64]], $MachinePrecision]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-84} \lor \neg \left(b \leq 8.8 \cdot 10^{+64}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if b < -2.0000000000000001e-84 or 8.80000000000000007e64 < b Initial program 94.8%
Taylor expanded in a around inf 62.9%
*-commutative62.9%
associate-*r*62.9%
Simplified62.9%
Taylor expanded in a around inf 46.9%
*-commutative46.9%
associate-*r*46.9%
*-commutative46.9%
Simplified46.9%
if -2.0000000000000001e-84 < b < 8.80000000000000007e64Initial program 99.2%
Taylor expanded in z around inf 55.0%
*-commutative55.0%
*-commutative55.0%
associate-*r*55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in z around 0 22.3%
Final simplification35.2%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.9%
Taylor expanded in z around inf 43.1%
*-commutative43.1%
*-commutative43.1%
associate-*r*43.1%
*-commutative43.1%
Simplified43.1%
Taylor expanded in z around 0 20.1%
Final simplification20.1%
herbie shell --seed 2024050
(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))