
(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 97.3%
associate-+l-97.3%
+-commutative97.3%
associate--l+97.3%
associate-*l/97.3%
*-commutative97.3%
fma-def98.4%
fma-neg99.6%
neg-sub099.6%
associate-+l-99.6%
neg-sub099.6%
+-commutative99.6%
unsub-neg99.6%
*-commutative99.6%
associate-*r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma y x (fma b (* a -0.25) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = fma(y, x, fma(b, (a * -0.25), c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = fma(y, x, fma(b, Float64(a * -0.25), c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(y * x + N[(b * N[(a * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(b, a \cdot -0.25, c\right)\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 z around 0 42.9%
+-commutative42.9%
*-commutative42.9%
*-commutative42.9%
*-commutative42.9%
associate-*r*42.9%
associate-+r-42.9%
*-commutative42.9%
fma-def85.7%
sub-neg85.7%
+-commutative85.7%
distribute-rgt-neg-in85.7%
fma-def85.7%
distribute-rgt-neg-in85.7%
metadata-eval85.7%
Simplified85.7%
Final simplification99.6%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (/ z (/ 16.0 t))) (- c (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, (z / (16.0 / t))) + (c - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(z / Float64(16.0 / t))) + Float64(c - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 97.3%
associate-+l-97.3%
sub-neg97.3%
neg-mul-197.3%
metadata-eval97.3%
metadata-eval97.3%
cancel-sign-sub-inv97.3%
fma-def97.7%
associate-/l*97.6%
metadata-eval97.6%
*-lft-identity97.6%
associate-/l*97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (* (* b a) -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + ((b * a) * -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 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + ((b * a) * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + ((b * a) * -0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(Float64(b * a) * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + ((b * a) * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\
\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 a around inf 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification98.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) -0.25)))
(if (<= (* b a) -8e+140)
t_1
(if (<= (* b a) 7.3e-38)
(+ c (* x y))
(if (<= (* b a) 3.1e+272) (+ c (* t (* z 0.0625))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -8e+140) {
tmp = t_1;
} else if ((b * a) <= 7.3e-38) {
tmp = c + (x * y);
} else if ((b * a) <= 3.1e+272) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (b * a) * (-0.25d0)
if ((b * a) <= (-8d+140)) then
tmp = t_1
else if ((b * a) <= 7.3d-38) then
tmp = c + (x * y)
else if ((b * a) <= 3.1d+272) then
tmp = c + (t * (z * 0.0625d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -8e+140) {
tmp = t_1;
} else if ((b * a) <= 7.3e-38) {
tmp = c + (x * y);
} else if ((b * a) <= 3.1e+272) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * -0.25 tmp = 0 if (b * a) <= -8e+140: tmp = t_1 elif (b * a) <= 7.3e-38: tmp = c + (x * y) elif (b * a) <= 3.1e+272: tmp = c + (t * (z * 0.0625)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -8e+140) tmp = t_1; elseif (Float64(b * a) <= 7.3e-38) tmp = Float64(c + Float64(x * y)); elseif (Float64(b * a) <= 3.1e+272) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (b * a) * -0.25; tmp = 0.0; if ((b * a) <= -8e+140) tmp = t_1; elseif ((b * a) <= 7.3e-38) tmp = c + (x * y); elseif ((b * a) <= 3.1e+272) tmp = c + (t * (z * 0.0625)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -8e+140], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 7.3e-38], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 3.1e+272], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -8 \cdot 10^{+140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 7.3 \cdot 10^{-38}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 3.1 \cdot 10^{+272}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -8.00000000000000047e140 or 3.09999999999999972e272 < (*.f64 a b) Initial program 89.6%
Taylor expanded in z around 0 86.0%
+-commutative86.0%
*-commutative86.0%
*-commutative86.0%
*-commutative86.0%
associate-*r*86.0%
associate-+r-86.0%
*-commutative86.0%
fma-def92.2%
sub-neg92.2%
+-commutative92.2%
distribute-rgt-neg-in92.2%
fma-def92.2%
distribute-rgt-neg-in92.2%
metadata-eval92.2%
Simplified92.2%
Taylor expanded in b around inf 84.2%
if -8.00000000000000047e140 < (*.f64 a b) < 7.3000000000000001e-38Initial program 98.7%
Taylor expanded in x around inf 67.6%
if 7.3000000000000001e-38 < (*.f64 a b) < 3.09999999999999972e272Initial program 100.0%
Taylor expanded in z around inf 60.7%
*-commutative60.7%
associate-*r*60.7%
*-commutative60.7%
Simplified60.7%
Final simplification69.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) -0.25)))
(if (<= (* b a) -5.2e+84)
(+ (* x y) t_1)
(if (<= (* b a) 5.3e+272) (+ c (+ (* x y) (* 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 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -5.2e+84) {
tmp = (x * y) + t_1;
} else if ((b * a) <= 5.3e+272) {
tmp = c + ((x * y) + (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 = (b * a) * (-0.25d0)
if ((b * a) <= (-5.2d+84)) then
tmp = (x * y) + t_1
else if ((b * a) <= 5.3d+272) then
tmp = c + ((x * y) + (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 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -5.2e+84) {
tmp = (x * y) + t_1;
} else if ((b * a) <= 5.3e+272) {
tmp = c + ((x * y) + (0.0625 * (t * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * -0.25 tmp = 0 if (b * a) <= -5.2e+84: tmp = (x * y) + t_1 elif (b * a) <= 5.3e+272: tmp = c + ((x * y) + (0.0625 * (t * z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -5.2e+84) tmp = Float64(Float64(x * y) + t_1); elseif (Float64(b * a) <= 5.3e+272) tmp = Float64(c + Float64(Float64(x * y) + 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 = (b * a) * -0.25; tmp = 0.0; if ((b * a) <= -5.2e+84) tmp = (x * y) + t_1; elseif ((b * a) <= 5.3e+272) tmp = c + ((x * y) + (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[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5.2e+84], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 5.3e+272], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -5.2 \cdot 10^{+84}:\\
\;\;\;\;x \cdot y + t_1\\
\mathbf{elif}\;b \cdot a \leq 5.3 \cdot 10^{+272}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.2000000000000002e84Initial program 90.2%
Taylor expanded in z around 0 83.6%
+-commutative83.6%
*-commutative83.6%
*-commutative83.6%
*-commutative83.6%
associate-*r*83.6%
associate-+r-83.6%
*-commutative83.6%
fma-def88.5%
sub-neg88.5%
+-commutative88.5%
distribute-rgt-neg-in88.5%
fma-def88.5%
distribute-rgt-neg-in88.5%
metadata-eval88.5%
Simplified88.5%
Taylor expanded in c around 0 81.2%
if -5.2000000000000002e84 < (*.f64 a b) < 5.30000000000000011e272Initial program 99.0%
Taylor expanded in a around 0 89.4%
if 5.30000000000000011e272 < (*.f64 a b) Initial program 92.9%
Taylor expanded in z around 0 92.9%
+-commutative92.9%
*-commutative92.9%
*-commutative92.9%
*-commutative92.9%
associate-*r*92.9%
associate-+r-92.9%
*-commutative92.9%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
Final simplification88.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))))
(if (<= (* b a) -3e+141)
(- t_1 (* (* b a) 0.25))
(if (<= (* b a) 8e+272) (+ c (+ (* x y) t_1)) (* (* b a) -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if ((b * a) <= -3e+141) {
tmp = t_1 - ((b * a) * 0.25);
} else if ((b * a) <= 8e+272) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (t * z)
if ((b * a) <= (-3d+141)) then
tmp = t_1 - ((b * a) * 0.25d0)
else if ((b * a) <= 8d+272) then
tmp = c + ((x * y) + t_1)
else
tmp = (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 t_1 = 0.0625 * (t * z);
double tmp;
if ((b * a) <= -3e+141) {
tmp = t_1 - ((b * a) * 0.25);
} else if ((b * a) <= 8e+272) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (b * a) * -0.25;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) tmp = 0 if (b * a) <= -3e+141: tmp = t_1 - ((b * a) * 0.25) elif (b * a) <= 8e+272: tmp = c + ((x * y) + t_1) else: tmp = (b * a) * -0.25 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (Float64(b * a) <= -3e+141) tmp = Float64(t_1 - Float64(Float64(b * a) * 0.25)); elseif (Float64(b * a) <= 8e+272) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(b * a) * -0.25); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (t * z); tmp = 0.0; if ((b * a) <= -3e+141) tmp = t_1 - ((b * a) * 0.25); elseif ((b * a) <= 8e+272) tmp = c + ((x * y) + t_1); else tmp = (b * a) * -0.25; 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]}, If[LessEqual[N[(b * a), $MachinePrecision], -3e+141], N[(t$95$1 - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 8e+272], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;b \cdot a \leq -3 \cdot 10^{+141}:\\
\;\;\;\;t_1 - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{elif}\;b \cdot a \leq 8 \cdot 10^{+272}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot a\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -2.9999999999999999e141Initial program 88.2%
Taylor expanded in x around 0 88.5%
Taylor expanded in c around 0 85.8%
if -2.9999999999999999e141 < (*.f64 a b) < 8.0000000000000005e272Initial program 99.0%
Taylor expanded in a around 0 88.8%
if 8.0000000000000005e272 < (*.f64 a b) Initial program 92.9%
Taylor expanded in z around 0 92.9%
+-commutative92.9%
*-commutative92.9%
*-commutative92.9%
*-commutative92.9%
associate-*r*92.9%
associate-+r-92.9%
*-commutative92.9%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
Final simplification89.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))))
(if (<= x -3.1e+150)
(* x y)
(if (<= x -6.2e+45)
(* (* b a) -0.25)
(if (<= x -1.05e+18)
c
(if (<= x -8e-134)
t_1
(if (<= x -4.5e-205)
c
(if (<= x -5.4e-252) t_1 (if (<= x 3.9e-37) c (* 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 tmp;
if (x <= -3.1e+150) {
tmp = x * y;
} else if (x <= -6.2e+45) {
tmp = (b * a) * -0.25;
} else if (x <= -1.05e+18) {
tmp = c;
} else if (x <= -8e-134) {
tmp = t_1;
} else if (x <= -4.5e-205) {
tmp = c;
} else if (x <= -5.4e-252) {
tmp = t_1;
} else if (x <= 3.9e-37) {
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) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (t * z)
if (x <= (-3.1d+150)) then
tmp = x * y
else if (x <= (-6.2d+45)) then
tmp = (b * a) * (-0.25d0)
else if (x <= (-1.05d+18)) then
tmp = c
else if (x <= (-8d-134)) then
tmp = t_1
else if (x <= (-4.5d-205)) then
tmp = c
else if (x <= (-5.4d-252)) then
tmp = t_1
else if (x <= 3.9d-37) 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 t_1 = 0.0625 * (t * z);
double tmp;
if (x <= -3.1e+150) {
tmp = x * y;
} else if (x <= -6.2e+45) {
tmp = (b * a) * -0.25;
} else if (x <= -1.05e+18) {
tmp = c;
} else if (x <= -8e-134) {
tmp = t_1;
} else if (x <= -4.5e-205) {
tmp = c;
} else if (x <= -5.4e-252) {
tmp = t_1;
} else if (x <= 3.9e-37) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) tmp = 0 if x <= -3.1e+150: tmp = x * y elif x <= -6.2e+45: tmp = (b * a) * -0.25 elif x <= -1.05e+18: tmp = c elif x <= -8e-134: tmp = t_1 elif x <= -4.5e-205: tmp = c elif x <= -5.4e-252: tmp = t_1 elif x <= 3.9e-37: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (x <= -3.1e+150) tmp = Float64(x * y); elseif (x <= -6.2e+45) tmp = Float64(Float64(b * a) * -0.25); elseif (x <= -1.05e+18) tmp = c; elseif (x <= -8e-134) tmp = t_1; elseif (x <= -4.5e-205) tmp = c; elseif (x <= -5.4e-252) tmp = t_1; elseif (x <= 3.9e-37) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (t * z); tmp = 0.0; if (x <= -3.1e+150) tmp = x * y; elseif (x <= -6.2e+45) tmp = (b * a) * -0.25; elseif (x <= -1.05e+18) tmp = c; elseif (x <= -8e-134) tmp = t_1; elseif (x <= -4.5e-205) tmp = c; elseif (x <= -5.4e-252) tmp = t_1; elseif (x <= 3.9e-37) tmp = c; else tmp = 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]}, If[LessEqual[x, -3.1e+150], N[(x * y), $MachinePrecision], If[LessEqual[x, -6.2e+45], N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision], If[LessEqual[x, -1.05e+18], c, If[LessEqual[x, -8e-134], t$95$1, If[LessEqual[x, -4.5e-205], c, If[LessEqual[x, -5.4e-252], t$95$1, If[LessEqual[x, 3.9e-37], c, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+150}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{+45}:\\
\;\;\;\;\left(b \cdot a\right) \cdot -0.25\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{+18}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-205}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-252}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-37}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -3.10000000000000014e150 or 3.8999999999999999e-37 < x Initial program 94.6%
Taylor expanded in z around 0 77.3%
+-commutative77.3%
*-commutative77.3%
*-commutative77.3%
*-commutative77.3%
associate-*r*77.3%
associate-+r-77.3%
*-commutative77.3%
fma-def79.9%
sub-neg79.9%
+-commutative79.9%
distribute-rgt-neg-in79.9%
fma-def79.9%
distribute-rgt-neg-in79.9%
metadata-eval79.9%
Simplified79.9%
Taylor expanded in y around inf 45.9%
if -3.10000000000000014e150 < x < -6.19999999999999975e45Initial program 100.0%
Taylor expanded in z around 0 79.1%
+-commutative79.1%
*-commutative79.1%
*-commutative79.1%
*-commutative79.1%
associate-*r*79.1%
associate-+r-79.1%
*-commutative79.1%
fma-def79.1%
sub-neg79.1%
+-commutative79.1%
distribute-rgt-neg-in79.1%
fma-def79.1%
distribute-rgt-neg-in79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in b around inf 19.5%
if -6.19999999999999975e45 < x < -1.05e18 or -8.00000000000000032e-134 < x < -4.49999999999999956e-205 or -5.39999999999999962e-252 < x < 3.8999999999999999e-37Initial program 100.0%
Taylor expanded in c around inf 42.9%
if -1.05e18 < x < -8.00000000000000032e-134 or -4.49999999999999956e-205 < x < -5.39999999999999962e-252Initial program 98.0%
Taylor expanded in x around 0 85.2%
Taylor expanded in t around inf 37.0%
Final simplification40.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) -0.25)))
(if (<= x -3.1e+150)
(* x y)
(if (<= x -1.35e+42)
t_1
(if (<= x -1.82e+37)
(* x y)
(if (<= x -4e-18)
c
(if (<= x -5.8e-182) t_1 (if (<= x 2.55e-36) c (* 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 (x <= -3.1e+150) {
tmp = x * y;
} else if (x <= -1.35e+42) {
tmp = t_1;
} else if (x <= -1.82e+37) {
tmp = x * y;
} else if (x <= -4e-18) {
tmp = c;
} else if (x <= -5.8e-182) {
tmp = t_1;
} else if (x <= 2.55e-36) {
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) :: t_1
real(8) :: tmp
t_1 = (b * a) * (-0.25d0)
if (x <= (-3.1d+150)) then
tmp = x * y
else if (x <= (-1.35d+42)) then
tmp = t_1
else if (x <= (-1.82d+37)) then
tmp = x * y
else if (x <= (-4d-18)) then
tmp = c
else if (x <= (-5.8d-182)) then
tmp = t_1
else if (x <= 2.55d-36) 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 t_1 = (b * a) * -0.25;
double tmp;
if (x <= -3.1e+150) {
tmp = x * y;
} else if (x <= -1.35e+42) {
tmp = t_1;
} else if (x <= -1.82e+37) {
tmp = x * y;
} else if (x <= -4e-18) {
tmp = c;
} else if (x <= -5.8e-182) {
tmp = t_1;
} else if (x <= 2.55e-36) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * -0.25 tmp = 0 if x <= -3.1e+150: tmp = x * y elif x <= -1.35e+42: tmp = t_1 elif x <= -1.82e+37: tmp = x * y elif x <= -4e-18: tmp = c elif x <= -5.8e-182: tmp = t_1 elif x <= 2.55e-36: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (x <= -3.1e+150) tmp = Float64(x * y); elseif (x <= -1.35e+42) tmp = t_1; elseif (x <= -1.82e+37) tmp = Float64(x * y); elseif (x <= -4e-18) tmp = c; elseif (x <= -5.8e-182) tmp = t_1; elseif (x <= 2.55e-36) tmp = c; 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 (x <= -3.1e+150) tmp = x * y; elseif (x <= -1.35e+42) tmp = t_1; elseif (x <= -1.82e+37) tmp = x * y; elseif (x <= -4e-18) tmp = c; elseif (x <= -5.8e-182) tmp = t_1; elseif (x <= 2.55e-36) tmp = c; else tmp = x * y; 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]}, If[LessEqual[x, -3.1e+150], N[(x * y), $MachinePrecision], If[LessEqual[x, -1.35e+42], t$95$1, If[LessEqual[x, -1.82e+37], N[(x * y), $MachinePrecision], If[LessEqual[x, -4e-18], c, If[LessEqual[x, -5.8e-182], t$95$1, If[LessEqual[x, 2.55e-36], c, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+150}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.82 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-18}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-182}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-36}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -3.10000000000000014e150 or -1.35e42 < x < -1.81999999999999998e37 or 2.54999999999999987e-36 < x Initial program 94.8%
Taylor expanded in z around 0 77.8%
+-commutative77.8%
*-commutative77.8%
*-commutative77.8%
*-commutative77.8%
associate-*r*77.8%
associate-+r-77.8%
*-commutative77.8%
fma-def80.5%
sub-neg80.5%
+-commutative80.5%
distribute-rgt-neg-in80.5%
fma-def80.5%
distribute-rgt-neg-in80.5%
metadata-eval80.5%
Simplified80.5%
Taylor expanded in y around inf 46.5%
if -3.10000000000000014e150 < x < -1.35e42 or -4.0000000000000003e-18 < x < -5.79999999999999974e-182Initial program 98.3%
Taylor expanded in z around 0 71.3%
+-commutative71.3%
*-commutative71.3%
*-commutative71.3%
*-commutative71.3%
associate-*r*71.3%
associate-+r-71.3%
*-commutative71.3%
fma-def71.3%
sub-neg71.3%
+-commutative71.3%
distribute-rgt-neg-in71.3%
fma-def71.3%
distribute-rgt-neg-in71.3%
metadata-eval71.3%
Simplified71.3%
Taylor expanded in b around inf 33.1%
if -1.81999999999999998e37 < x < -4.0000000000000003e-18 or -5.79999999999999974e-182 < x < 2.54999999999999987e-36Initial program 100.0%
Taylor expanded in c around inf 44.0%
Final simplification42.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -1.55e+119) (not (<= (* b a) 1.15e+64))) (+ c (* (* b a) -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 * a) <= -1.55e+119) || !((b * a) <= 1.15e+64)) {
tmp = c + ((b * a) * -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 * a) <= (-1.55d+119)) .or. (.not. ((b * a) <= 1.15d+64))) then
tmp = c + ((b * a) * (-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 * a) <= -1.55e+119) || !((b * a) <= 1.15e+64)) {
tmp = c + ((b * a) * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -1.55e+119) or not ((b * a) <= 1.15e+64): tmp = c + ((b * a) * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -1.55e+119) || !(Float64(b * a) <= 1.15e+64)) tmp = Float64(c + Float64(Float64(b * a) * -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 * a) <= -1.55e+119) || ~(((b * a) <= 1.15e+64))) tmp = c + ((b * a) * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -1.55e+119], N[Not[LessEqual[N[(b * a), $MachinePrecision], 1.15e+64]], $MachinePrecision]], N[(c + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1.55 \cdot 10^{+119} \lor \neg \left(b \cdot a \leq 1.15 \cdot 10^{+64}\right):\\
\;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -1.54999999999999998e119 or 1.15e64 < (*.f64 a b) Initial program 93.6%
Taylor expanded in a around inf 73.0%
*-commutative73.0%
Simplified73.0%
if -1.54999999999999998e119 < (*.f64 a b) < 1.15e64Initial program 98.9%
Taylor expanded in x around inf 67.3%
Final simplification69.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -4.1e+83) (not (<= z 5.6e-64))) (+ c (+ (* x y) (* 0.0625 (* t z)))) (- (+ c (* x y)) (* (* b a) 0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -4.1e+83) || !(z <= 5.6e-64)) {
tmp = c + ((x * y) + (0.0625 * (t * z)));
} else {
tmp = (c + (x * y)) - ((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 ((z <= (-4.1d+83)) .or. (.not. (z <= 5.6d-64))) then
tmp = c + ((x * y) + (0.0625d0 * (t * z)))
else
tmp = (c + (x * y)) - ((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 ((z <= -4.1e+83) || !(z <= 5.6e-64)) {
tmp = c + ((x * y) + (0.0625 * (t * z)));
} else {
tmp = (c + (x * y)) - ((b * a) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -4.1e+83) or not (z <= 5.6e-64): tmp = c + ((x * y) + (0.0625 * (t * z))) else: tmp = (c + (x * y)) - ((b * a) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -4.1e+83) || !(z <= 5.6e-64)) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(t * z)))); else tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -4.1e+83) || ~((z <= 5.6e-64))) tmp = c + ((x * y) + (0.0625 * (t * z))); else tmp = (c + (x * y)) - ((b * a) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -4.1e+83], N[Not[LessEqual[z, 5.6e-64]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+83} \lor \neg \left(z \leq 5.6 \cdot 10^{-64}\right):\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\end{array}
\end{array}
if z < -4.1000000000000001e83 or 5.60000000000000008e-64 < z Initial program 95.4%
Taylor expanded in a around 0 83.9%
if -4.1000000000000001e83 < z < 5.60000000000000008e-64Initial program 98.6%
Taylor expanded in z around 0 91.0%
Final simplification88.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* b a) -0.25)))
(if (<= (* b a) -3.6e+63)
(+ (* x y) t_1)
(if (<= (* b a) 1.15e+64) (+ c (* x y)) (+ c 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 tmp;
if ((b * a) <= -3.6e+63) {
tmp = (x * y) + t_1;
} else if ((b * a) <= 1.15e+64) {
tmp = c + (x * y);
} else {
tmp = c + 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 = (b * a) * (-0.25d0)
if ((b * a) <= (-3.6d+63)) then
tmp = (x * y) + t_1
else if ((b * a) <= 1.15d+64) then
tmp = c + (x * y)
else
tmp = c + 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 tmp;
if ((b * a) <= -3.6e+63) {
tmp = (x * y) + t_1;
} else if ((b * a) <= 1.15e+64) {
tmp = c + (x * y);
} else {
tmp = c + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (b * a) * -0.25 tmp = 0 if (b * a) <= -3.6e+63: tmp = (x * y) + t_1 elif (b * a) <= 1.15e+64: tmp = c + (x * y) else: tmp = c + t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -3.6e+63) tmp = Float64(Float64(x * y) + t_1); elseif (Float64(b * a) <= 1.15e+64) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + t_1); 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 ((b * a) <= -3.6e+63) tmp = (x * y) + t_1; elseif ((b * a) <= 1.15e+64) tmp = c + (x * y); else tmp = c + 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]}, If[LessEqual[N[(b * a), $MachinePrecision], -3.6e+63], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 1.15e+64], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -3.6 \cdot 10^{+63}:\\
\;\;\;\;x \cdot y + t_1\\
\mathbf{elif}\;b \cdot a \leq 1.15 \cdot 10^{+64}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -3.59999999999999999e63Initial program 91.1%
Taylor expanded in z around 0 80.6%
+-commutative80.6%
*-commutative80.6%
*-commutative80.6%
*-commutative80.6%
associate-*r*80.6%
associate-+r-80.6%
*-commutative80.6%
fma-def85.0%
sub-neg85.0%
+-commutative85.0%
distribute-rgt-neg-in85.0%
fma-def85.1%
distribute-rgt-neg-in85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in c around 0 77.4%
if -3.59999999999999999e63 < (*.f64 a b) < 1.15e64Initial program 98.8%
Taylor expanded in x around inf 68.1%
if 1.15e64 < (*.f64 a b) Initial program 97.6%
Taylor expanded in a around inf 69.4%
*-commutative69.4%
Simplified69.4%
Final simplification69.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -1.6e+141) (not (<= (* b a) 3.1e+272))) (* (* b a) -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 * a) <= -1.6e+141) || !((b * a) <= 3.1e+272)) {
tmp = (b * a) * -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 * a) <= (-1.6d+141)) .or. (.not. ((b * a) <= 3.1d+272))) then
tmp = (b * a) * (-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 * a) <= -1.6e+141) || !((b * a) <= 3.1e+272)) {
tmp = (b * a) * -0.25;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -1.6e+141) or not ((b * a) <= 3.1e+272): tmp = (b * a) * -0.25 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -1.6e+141) || !(Float64(b * a) <= 3.1e+272)) tmp = Float64(Float64(b * a) * -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 * a) <= -1.6e+141) || ~(((b * a) <= 3.1e+272))) tmp = (b * a) * -0.25; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -1.6e+141], N[Not[LessEqual[N[(b * a), $MachinePrecision], 3.1e+272]], $MachinePrecision]], N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1.6 \cdot 10^{+141} \lor \neg \left(b \cdot a \leq 3.1 \cdot 10^{+272}\right):\\
\;\;\;\;\left(b \cdot a\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -1.60000000000000009e141 or 3.09999999999999972e272 < (*.f64 a b) Initial program 89.6%
Taylor expanded in z around 0 86.0%
+-commutative86.0%
*-commutative86.0%
*-commutative86.0%
*-commutative86.0%
associate-*r*86.0%
associate-+r-86.0%
*-commutative86.0%
fma-def92.2%
sub-neg92.2%
+-commutative92.2%
distribute-rgt-neg-in92.2%
fma-def92.2%
distribute-rgt-neg-in92.2%
metadata-eval92.2%
Simplified92.2%
Taylor expanded in b around inf 84.2%
if -1.60000000000000009e141 < (*.f64 a b) < 3.09999999999999972e272Initial program 99.0%
Taylor expanded in x around inf 63.5%
Final simplification67.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= x -1.95e+37) (* x y) (if (<= x 1e-36) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -1.95e+37) {
tmp = x * y;
} else if (x <= 1e-36) {
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 <= (-1.95d+37)) then
tmp = x * y
else if (x <= 1d-36) 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 <= -1.95e+37) {
tmp = x * y;
} else if (x <= 1e-36) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if x <= -1.95e+37: tmp = x * y elif x <= 1e-36: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -1.95e+37) tmp = Float64(x * y); elseif (x <= 1e-36) 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 <= -1.95e+37) tmp = x * y; elseif (x <= 1e-36) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -1.95e+37], N[(x * y), $MachinePrecision], If[LessEqual[x, 1e-36], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 10^{-36}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -1.9499999999999999e37 or 9.9999999999999994e-37 < x Initial program 95.7%
Taylor expanded in z around 0 78.2%
+-commutative78.2%
*-commutative78.2%
*-commutative78.2%
*-commutative78.2%
associate-*r*78.2%
associate-+r-78.2%
*-commutative78.2%
fma-def80.4%
sub-neg80.4%
+-commutative80.4%
distribute-rgt-neg-in80.4%
fma-def80.4%
distribute-rgt-neg-in80.4%
metadata-eval80.4%
Simplified80.4%
Taylor expanded in y around inf 45.9%
if -1.9499999999999999e37 < x < 9.9999999999999994e-37Initial program 99.1%
Taylor expanded in c around inf 33.8%
Final simplification40.4%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 97.3%
Taylor expanded in c around inf 27.1%
Final simplification27.1%
herbie shell --seed 2023228
(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))