
(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 14 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 (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 (* x (/ y c)))))
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 * (x * (y / c));
}
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(x * Float64(y / c))); 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[(x * N[(y / c), $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 \cdot \left(x \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 99.7%
associate-+l-99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
associate-+l-99.7%
fma-define99.7%
*-commutative99.7%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in x around inf 47.0%
Taylor expanded in c around inf 47.0%
Taylor expanded in x around inf 46.5%
associate-*r/55.3%
Simplified55.3%
Final simplification98.1%
(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 95.4%
associate--l+95.4%
fma-define95.8%
associate-/l*96.1%
fma-neg97.3%
distribute-neg-frac297.3%
metadata-eval97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -7.2e+93)
(* x y)
(if (<= (* x y) -2.35e-287)
(* t (* z 0.0625))
(if (<= (* x y) 1.55e-245)
c
(if (<= (* x y) 1.22e-194)
(* b (* a -0.25))
(if (<= (* x y) 6000.0) c (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -7.2e+93) {
tmp = x * y;
} else if ((x * y) <= -2.35e-287) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 1.55e-245) {
tmp = c;
} else if ((x * y) <= 1.22e-194) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 6000.0) {
tmp = c;
} 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 ((x * y) <= (-7.2d+93)) then
tmp = x * y
else if ((x * y) <= (-2.35d-287)) then
tmp = t * (z * 0.0625d0)
else if ((x * y) <= 1.55d-245) then
tmp = c
else if ((x * y) <= 1.22d-194) then
tmp = b * (a * (-0.25d0))
else if ((x * y) <= 6000.0d0) then
tmp = c
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 ((x * y) <= -7.2e+93) {
tmp = x * y;
} else if ((x * y) <= -2.35e-287) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 1.55e-245) {
tmp = c;
} else if ((x * y) <= 1.22e-194) {
tmp = b * (a * -0.25);
} else if ((x * y) <= 6000.0) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -7.2e+93: tmp = x * y elif (x * y) <= -2.35e-287: tmp = t * (z * 0.0625) elif (x * y) <= 1.55e-245: tmp = c elif (x * y) <= 1.22e-194: tmp = b * (a * -0.25) elif (x * y) <= 6000.0: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -7.2e+93) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.35e-287) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(x * y) <= 1.55e-245) tmp = c; elseif (Float64(x * y) <= 1.22e-194) tmp = Float64(b * Float64(a * -0.25)); elseif (Float64(x * y) <= 6000.0) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -7.2e+93) tmp = x * y; elseif ((x * y) <= -2.35e-287) tmp = t * (z * 0.0625); elseif ((x * y) <= 1.55e-245) tmp = c; elseif ((x * y) <= 1.22e-194) tmp = b * (a * -0.25); elseif ((x * y) <= 6000.0) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -7.2e+93], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.35e-287], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.55e-245], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.22e-194], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6000.0], c, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.2 \cdot 10^{+93}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.35 \cdot 10^{-287}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-245}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.22 \cdot 10^{-194}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 6000:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.1999999999999998e93 or 6e3 < (*.f64 x y) Initial program 92.1%
Taylor expanded in x around inf 71.0%
Taylor expanded in c around inf 63.5%
Taylor expanded in c around 0 62.4%
if -7.1999999999999998e93 < (*.f64 x y) < -2.3499999999999999e-287Initial program 98.4%
Taylor expanded in a around 0 69.8%
Taylor expanded in c around 0 41.1%
Taylor expanded in t around inf 37.6%
*-commutative37.6%
associate-*r*39.1%
*-commutative39.1%
Simplified39.1%
if -2.3499999999999999e-287 < (*.f64 x y) < 1.55000000000000001e-245 or 1.2200000000000001e-194 < (*.f64 x y) < 6e3Initial program 98.7%
Taylor expanded in c around inf 44.9%
if 1.55000000000000001e-245 < (*.f64 x y) < 1.2200000000000001e-194Initial program 88.9%
Taylor expanded in z around 0 56.3%
Taylor expanded in a around inf 54.5%
associate-*r*54.5%
*-commutative54.5%
Simplified54.5%
Final simplification51.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))))
(if (<= (* x y) -1e+105)
(+ c (* x y))
(if (<= (* x y) 2e-233)
t_1
(if (<= (* x y) 5e-101)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 10.0) t_1 (+ (* x y) (* 0.0625 (* z t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -1e+105) {
tmp = c + (x * y);
} else if ((x * y) <= 2e-233) {
tmp = t_1;
} else if ((x * y) <= 5e-101) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 10.0) {
tmp = t_1;
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
if ((x * y) <= (-1d+105)) then
tmp = c + (x * y)
else if ((x * y) <= 2d-233) then
tmp = t_1
else if ((x * y) <= 5d-101) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 10.0d0) then
tmp = t_1
else
tmp = (x * y) + (0.0625d0 * (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -1e+105) {
tmp = c + (x * y);
} else if ((x * y) <= 2e-233) {
tmp = t_1;
} else if ((x * y) <= 5e-101) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 10.0) {
tmp = t_1;
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) tmp = 0 if (x * y) <= -1e+105: tmp = c + (x * y) elif (x * y) <= 2e-233: tmp = t_1 elif (x * y) <= 5e-101: tmp = c + (b * (a * -0.25)) elif (x * y) <= 10.0: tmp = t_1 else: tmp = (x * y) + (0.0625 * (z * t)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) tmp = 0.0 if (Float64(x * y) <= -1e+105) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= 2e-233) tmp = t_1; elseif (Float64(x * y) <= 5e-101) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 10.0) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (t * (z * 0.0625)); tmp = 0.0; if ((x * y) <= -1e+105) tmp = c + (x * y); elseif ((x * y) <= 2e-233) tmp = t_1; elseif ((x * y) <= 5e-101) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 10.0) tmp = t_1; else tmp = (x * y) + (0.0625 * (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+105], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-233], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-101], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 10.0], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+105}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-233}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-101}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e104Initial program 88.1%
Taylor expanded in x around inf 79.3%
if -9.9999999999999994e104 < (*.f64 x y) < 1.99999999999999992e-233 or 5.0000000000000001e-101 < (*.f64 x y) < 10Initial program 97.6%
Taylor expanded in z around inf 71.9%
associate-*r*72.6%
*-commutative72.6%
associate-*r*72.6%
Simplified72.6%
if 1.99999999999999992e-233 < (*.f64 x y) < 5.0000000000000001e-101Initial program 100.0%
Taylor expanded in a around inf 76.6%
*-commutative76.6%
*-commutative76.6%
associate-*r*76.6%
Simplified76.6%
if 10 < (*.f64 x y) Initial program 94.3%
Taylor expanded in a around 0 79.8%
Taylor expanded in c around 0 72.7%
Final simplification74.1%
(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 (* x (/ y c))))))
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 * (x * (y / c));
}
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 * (x * (y / c));
}
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 * (x * (y / c)) 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(x * Float64(y / c))); 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 * (x * (y / c)); 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[(x * N[(y / c), $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 \cdot \left(x \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 99.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in x around inf 47.0%
Taylor expanded in c around inf 47.0%
Taylor expanded in x around inf 46.5%
associate-*r/55.3%
Simplified55.3%
Final simplification97.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -1e+105)
t_2
(if (<= (* x y) 2e-233)
t_1
(if (<= (* x y) 5e-101)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 5e+17) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1e+105) {
tmp = t_2;
} else if ((x * y) <= 2e-233) {
tmp = t_1;
} else if ((x * y) <= 5e-101) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 5e+17) {
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 + (t * (z * 0.0625d0))
t_2 = c + (x * y)
if ((x * y) <= (-1d+105)) then
tmp = t_2
else if ((x * y) <= 2d-233) then
tmp = t_1
else if ((x * y) <= 5d-101) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 5d+17) 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 + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1e+105) {
tmp = t_2;
} else if ((x * y) <= 2e-233) {
tmp = t_1;
} else if ((x * y) <= 5e-101) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 5e+17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -1e+105: tmp = t_2 elif (x * y) <= 2e-233: tmp = t_1 elif (x * y) <= 5e-101: tmp = c + (b * (a * -0.25)) elif (x * y) <= 5e+17: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1e+105) tmp = t_2; elseif (Float64(x * y) <= 2e-233) tmp = t_1; elseif (Float64(x * y) <= 5e-101) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 5e+17) 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 + (t * (z * 0.0625)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -1e+105) tmp = t_2; elseif ((x * y) <= 2e-233) tmp = t_1; elseif ((x * y) <= 5e-101) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 5e+17) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+105], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e-233], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-101], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+17], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+105}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-233}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-101}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e104 or 5e17 < (*.f64 x y) Initial program 91.7%
Taylor expanded in x around inf 73.9%
if -9.9999999999999994e104 < (*.f64 x y) < 1.99999999999999992e-233 or 5.0000000000000001e-101 < (*.f64 x y) < 5e17Initial program 97.7%
Taylor expanded in z around inf 72.0%
associate-*r*72.7%
*-commutative72.7%
associate-*r*72.7%
Simplified72.7%
if 1.99999999999999992e-233 < (*.f64 x y) < 5.0000000000000001e-101Initial program 100.0%
Taylor expanded in a around inf 76.6%
*-commutative76.6%
*-commutative76.6%
associate-*r*76.6%
Simplified76.6%
Final simplification73.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= c -5.3e+111)
(+ c (* t (* z 0.0625)))
(if (<= c 7e-227)
t_1
(if (<= c 6.9e-93)
(+ (* x y) (* 0.0625 (* z t)))
(if (<= c 4.2e+79) t_1 (* c (+ 1.0 (/ (* x y) c)))))))))
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 (c <= -5.3e+111) {
tmp = c + (t * (z * 0.0625));
} else if (c <= 7e-227) {
tmp = t_1;
} else if (c <= 6.9e-93) {
tmp = (x * y) + (0.0625 * (z * t));
} else if (c <= 4.2e+79) {
tmp = t_1;
} else {
tmp = c * (1.0 + ((x * y) / 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) :: t_1
real(8) :: tmp
t_1 = (x * y) - ((a * b) * 0.25d0)
if (c <= (-5.3d+111)) then
tmp = c + (t * (z * 0.0625d0))
else if (c <= 7d-227) then
tmp = t_1
else if (c <= 6.9d-93) then
tmp = (x * y) + (0.0625d0 * (z * t))
else if (c <= 4.2d+79) then
tmp = t_1
else
tmp = c * (1.0d0 + ((x * y) / 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 t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if (c <= -5.3e+111) {
tmp = c + (t * (z * 0.0625));
} else if (c <= 7e-227) {
tmp = t_1;
} else if (c <= 6.9e-93) {
tmp = (x * y) + (0.0625 * (z * t));
} else if (c <= 4.2e+79) {
tmp = t_1;
} else {
tmp = c * (1.0 + ((x * y) / c));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if c <= -5.3e+111: tmp = c + (t * (z * 0.0625)) elif c <= 7e-227: tmp = t_1 elif c <= 6.9e-93: tmp = (x * y) + (0.0625 * (z * t)) elif c <= 4.2e+79: tmp = t_1 else: tmp = c * (1.0 + ((x * y) / c)) 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 (c <= -5.3e+111) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (c <= 7e-227) tmp = t_1; elseif (c <= 6.9e-93) tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); elseif (c <= 4.2e+79) tmp = t_1; else tmp = Float64(c * Float64(1.0 + Float64(Float64(x * y) / c))); 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 (c <= -5.3e+111) tmp = c + (t * (z * 0.0625)); elseif (c <= 7e-227) tmp = t_1; elseif (c <= 6.9e-93) tmp = (x * y) + (0.0625 * (z * t)); elseif (c <= 4.2e+79) tmp = t_1; else tmp = c * (1.0 + ((x * y) / c)); 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[c, -5.3e+111], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7e-227], t$95$1, If[LessEqual[c, 6.9e-93], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.2e+79], t$95$1, N[(c * N[(1.0 + N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;c \leq -5.3 \cdot 10^{+111}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;c \leq 7 \cdot 10^{-227}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 6.9 \cdot 10^{-93}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(1 + \frac{x \cdot y}{c}\right)\\
\end{array}
\end{array}
if c < -5.2999999999999998e111Initial program 95.3%
Taylor expanded in z around inf 81.7%
associate-*r*81.7%
*-commutative81.7%
associate-*r*81.7%
Simplified81.7%
if -5.2999999999999998e111 < c < 7.0000000000000002e-227 or 6.90000000000000031e-93 < c < 4.20000000000000016e79Initial program 93.9%
Taylor expanded in z around 0 79.7%
Taylor expanded in c around 0 72.7%
if 7.0000000000000002e-227 < c < 6.90000000000000031e-93Initial program 96.9%
Taylor expanded in a around 0 89.7%
Taylor expanded in c around 0 82.9%
if 4.20000000000000016e79 < c Initial program 98.1%
Taylor expanded in x around inf 73.6%
Taylor expanded in c around inf 73.6%
Final simplification75.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* t (* z 0.0625))))
(if (<= z -4e+184)
t_2
(if (<= z -3.5e-287)
t_1
(if (<= z 1.3e-276) (* b (* a -0.25)) (if (<= z 1.45e-40) 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 = t * (z * 0.0625);
double tmp;
if (z <= -4e+184) {
tmp = t_2;
} else if (z <= -3.5e-287) {
tmp = t_1;
} else if (z <= 1.3e-276) {
tmp = b * (a * -0.25);
} else if (z <= 1.45e-40) {
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 = t * (z * 0.0625d0)
if (z <= (-4d+184)) then
tmp = t_2
else if (z <= (-3.5d-287)) then
tmp = t_1
else if (z <= 1.3d-276) then
tmp = b * (a * (-0.25d0))
else if (z <= 1.45d-40) 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 = t * (z * 0.0625);
double tmp;
if (z <= -4e+184) {
tmp = t_2;
} else if (z <= -3.5e-287) {
tmp = t_1;
} else if (z <= 1.3e-276) {
tmp = b * (a * -0.25);
} else if (z <= 1.45e-40) {
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 = t * (z * 0.0625) tmp = 0 if z <= -4e+184: tmp = t_2 elif z <= -3.5e-287: tmp = t_1 elif z <= 1.3e-276: tmp = b * (a * -0.25) elif z <= 1.45e-40: 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(t * Float64(z * 0.0625)) tmp = 0.0 if (z <= -4e+184) tmp = t_2; elseif (z <= -3.5e-287) tmp = t_1; elseif (z <= 1.3e-276) tmp = Float64(b * Float64(a * -0.25)); elseif (z <= 1.45e-40) 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 = t * (z * 0.0625); tmp = 0.0; if (z <= -4e+184) tmp = t_2; elseif (z <= -3.5e-287) tmp = t_1; elseif (z <= 1.3e-276) tmp = b * (a * -0.25); elseif (z <= 1.45e-40) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+184], t$95$2, If[LessEqual[z, -3.5e-287], t$95$1, If[LessEqual[z, 1.3e-276], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-40], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{+184}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-287}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-276}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.00000000000000007e184 or 1.4499999999999999e-40 < z Initial program 90.8%
Taylor expanded in a around 0 80.9%
Taylor expanded in c around 0 65.7%
Taylor expanded in t around inf 47.2%
*-commutative47.2%
associate-*r*48.1%
*-commutative48.1%
Simplified48.1%
if -4.00000000000000007e184 < z < -3.5e-287 or 1.29999999999999992e-276 < z < 1.4499999999999999e-40Initial program 98.0%
Taylor expanded in x around inf 63.6%
if -3.5e-287 < z < 1.29999999999999992e-276Initial program 100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in a around inf 71.5%
associate-*r*71.5%
*-commutative71.5%
Simplified71.5%
Final simplification58.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+139) (not (<= (* a b) 1e+150))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+139) || !((a * b) <= 1e+150)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-5d+139)) .or. (.not. ((a * b) <= 1d+150))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+139) || !((a * b) <= 1e+150)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+139) or not ((a * b) <= 1e+150): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+139) || !(Float64(a * b) <= 1e+150)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+139) || ~(((a * b) <= 1e+150))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+139], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+150]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+139} \lor \neg \left(a \cdot b \leq 10^{+150}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000003e139 or 9.99999999999999981e149 < (*.f64 a b) Initial program 86.9%
Taylor expanded in z around 0 87.0%
if -5.0000000000000003e139 < (*.f64 a b) < 9.99999999999999981e149Initial program 98.9%
Taylor expanded in a around 0 94.0%
Final simplification92.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+139)
(+ c (* b (* a -0.25)))
(if (<= (* a b) 1e+150)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* 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+139) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+150) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (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+139)) then
tmp = c + (b * (a * (-0.25d0)))
else if ((a * b) <= 1d+150) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (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+139) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+150) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+139: tmp = c + (b * (a * -0.25)) elif (a * b) <= 1e+150: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (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+139) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(a * b) <= 1e+150) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(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+139) tmp = c + (b * (a * -0.25)); elseif ((a * b) <= 1e+150) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (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+139], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+150], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $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^{+139}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+150}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000003e139Initial program 89.3%
Taylor expanded in a around inf 78.8%
*-commutative78.8%
*-commutative78.8%
associate-*r*78.8%
Simplified78.8%
if -5.0000000000000003e139 < (*.f64 a b) < 9.99999999999999981e149Initial program 98.9%
Taylor expanded in a around 0 94.0%
if 9.99999999999999981e149 < (*.f64 a b) Initial program 84.6%
Taylor expanded in z around 0 89.7%
Taylor expanded in c around 0 87.5%
Final simplification90.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -3e+92)
(* x y)
(if (<= (* x y) -1.3e-287)
(* t (* z 0.0625))
(if (<= (* x y) 4200000.0) c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -3e+92) {
tmp = x * y;
} else if ((x * y) <= -1.3e-287) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 4200000.0) {
tmp = c;
} 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 ((x * y) <= (-3d+92)) then
tmp = x * y
else if ((x * y) <= (-1.3d-287)) then
tmp = t * (z * 0.0625d0)
else if ((x * y) <= 4200000.0d0) then
tmp = c
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 ((x * y) <= -3e+92) {
tmp = x * y;
} else if ((x * y) <= -1.3e-287) {
tmp = t * (z * 0.0625);
} else if ((x * y) <= 4200000.0) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -3e+92: tmp = x * y elif (x * y) <= -1.3e-287: tmp = t * (z * 0.0625) elif (x * y) <= 4200000.0: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -3e+92) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.3e-287) tmp = Float64(t * Float64(z * 0.0625)); elseif (Float64(x * y) <= 4200000.0) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -3e+92) tmp = x * y; elseif ((x * y) <= -1.3e-287) tmp = t * (z * 0.0625); elseif ((x * y) <= 4200000.0) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -3e+92], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.3e-287], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4200000.0], c, N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3 \cdot 10^{+92}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.3 \cdot 10^{-287}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 4200000:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.00000000000000013e92 or 4.2e6 < (*.f64 x y) Initial program 92.1%
Taylor expanded in x around inf 71.0%
Taylor expanded in c around inf 63.5%
Taylor expanded in c around 0 62.4%
if -3.00000000000000013e92 < (*.f64 x y) < -1.3e-287Initial program 98.4%
Taylor expanded in a around 0 69.8%
Taylor expanded in c around 0 41.1%
Taylor expanded in t around inf 37.6%
*-commutative37.6%
associate-*r*39.1%
*-commutative39.1%
Simplified39.1%
if -1.3e-287 < (*.f64 x y) < 4.2e6Initial program 97.7%
Taylor expanded in c around inf 40.8%
Final simplification50.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -5e+123) (not (<= (* x y) 400000000.0))) (+ c (* x y)) (+ c (* b (* a -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -5e+123) || !((x * y) <= 400000000.0)) {
tmp = c + (x * y);
} else {
tmp = c + (b * (a * -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) <= (-5d+123)) .or. (.not. ((x * y) <= 400000000.0d0))) then
tmp = c + (x * y)
else
tmp = c + (b * (a * (-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) <= -5e+123) || !((x * y) <= 400000000.0)) {
tmp = c + (x * y);
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -5e+123) or not ((x * y) <= 400000000.0): tmp = c + (x * y) else: tmp = c + (b * (a * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -5e+123) || !(Float64(x * y) <= 400000000.0)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(b * Float64(a * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -5e+123) || ~(((x * y) <= 400000000.0))) tmp = c + (x * y); else tmp = c + (b * (a * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+123], N[Not[LessEqual[N[(x * y), $MachinePrecision], 400000000.0]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+123} \lor \neg \left(x \cdot y \leq 400000000\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999974e123 or 4e8 < (*.f64 x y) Initial program 91.7%
Taylor expanded in x around inf 73.8%
if -4.99999999999999974e123 < (*.f64 x y) < 4e8Initial program 98.1%
Taylor expanded in a around inf 65.4%
*-commutative65.4%
*-commutative65.4%
associate-*r*65.4%
Simplified65.4%
Final simplification69.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.15e+104) (not (<= (* x y) 4100000.0))) (* 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+104) || !((x * y) <= 4100000.0)) {
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+104)) .or. (.not. ((x * y) <= 4100000.0d0))) 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+104) || !((x * y) <= 4100000.0)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.15e+104) or not ((x * y) <= 4100000.0): 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+104) || !(Float64(x * y) <= 4100000.0)) 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+104) || ~(((x * y) <= 4100000.0))) 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+104], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4100000.0]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+104} \lor \neg \left(x \cdot y \leq 4100000\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.14999999999999992e104 or 4.1e6 < (*.f64 x y) Initial program 92.0%
Taylor expanded in x around inf 70.7%
Taylor expanded in c around inf 63.2%
Taylor expanded in c around 0 62.9%
if -1.14999999999999992e104 < (*.f64 x y) < 4.1e6Initial program 98.0%
Taylor expanded in c around inf 37.1%
Final simplification48.5%
(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 95.4%
Taylor expanded in c around inf 25.3%
Final simplification25.3%
herbie shell --seed 2024066
(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))