
(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
(let* ((t_1 (/ (* a b) 4.0)))
(if (<= (- (+ (* x y) (/ (* z t) 16.0)) t_1) INFINITY)
(+ c (- (fma (* z 0.0625) t (* x y)) t_1))
(+ c (fma (* t 0.0625) z (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) / 4.0;
double tmp;
if ((((x * y) + ((z * t) / 16.0)) - t_1) <= ((double) INFINITY)) {
tmp = c + (fma((z * 0.0625), t, (x * y)) - t_1);
} else {
tmp = c + fma((t * 0.0625), z, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) / 4.0) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - t_1) <= Inf) tmp = Float64(c + Float64(fma(Float64(z * 0.0625), t, Float64(x * y)) - t_1)); else tmp = Float64(c + fma(Float64(t * 0.0625), z, Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], Infinity], N[(c + N[(N[(N[(z * 0.0625), $MachinePrecision] * t + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(t * 0.0625), $MachinePrecision] * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - t\_1 \leq \infty:\\
\;\;\;\;c + \left(\mathsf{fma}\left(z \cdot 0.0625, t, x \cdot y\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + \mathsf{fma}\left(t \cdot 0.0625, z, x \cdot y\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%
+-commutative100.0%
associate-/l*99.9%
associate-/r/100.0%
fma-def100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.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 0 40.0%
associate-*r*40.0%
fma-def70.0%
Applied egg-rr70.0%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 96.1%
associate-+l-96.1%
associate--l+96.1%
fma-def96.9%
associate-*l/96.9%
fma-neg97.3%
sub-neg97.3%
distribute-neg-in97.3%
remove-double-neg97.3%
associate-/l*97.2%
distribute-frac-neg97.2%
associate-/r/97.3%
fma-def97.3%
neg-mul-197.3%
*-commutative97.3%
associate-/l*97.3%
metadata-eval97.3%
Simplified97.3%
Final simplification97.3%
(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 (fma (* t 0.0625) z (* x y))))))
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 + fma((t * 0.0625), z, (x * y));
}
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 + fma(Float64(t * 0.0625), z, Float64(x * y))); end return 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[(t * 0.0625), $MachinePrecision] * z + N[(x * y), $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 + \mathsf{fma}\left(t \cdot 0.0625, z, x \cdot y\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 a around 0 40.0%
associate-*r*40.0%
fma-def70.0%
Applied egg-rr70.0%
Final simplification98.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625))
(t_2 (+ c (+ (* x y) t_1)))
(t_3 (+ c (* a (* b -0.25)))))
(if (<= (* a b) -5e+154)
t_3
(if (<= (* a b) 5e+30)
t_2
(if (<= (* a b) 5e+181)
(- t_1 (* (* a b) 0.25))
(if (<= (* a b) 2e+219) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double t_2 = c + ((x * y) + t_1);
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((a * b) <= -5e+154) {
tmp = t_3;
} else if ((a * b) <= 5e+30) {
tmp = t_2;
} else if ((a * b) <= 5e+181) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 2e+219) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (z * t) * 0.0625d0
t_2 = c + ((x * y) + t_1)
t_3 = c + (a * (b * (-0.25d0)))
if ((a * b) <= (-5d+154)) then
tmp = t_3
else if ((a * b) <= 5d+30) then
tmp = t_2
else if ((a * b) <= 5d+181) then
tmp = t_1 - ((a * b) * 0.25d0)
else if ((a * b) <= 2d+219) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double t_2 = c + ((x * y) + t_1);
double t_3 = c + (a * (b * -0.25));
double tmp;
if ((a * b) <= -5e+154) {
tmp = t_3;
} else if ((a * b) <= 5e+30) {
tmp = t_2;
} else if ((a * b) <= 5e+181) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 2e+219) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 t_2 = c + ((x * y) + t_1) t_3 = c + (a * (b * -0.25)) tmp = 0 if (a * b) <= -5e+154: tmp = t_3 elif (a * b) <= 5e+30: tmp = t_2 elif (a * b) <= 5e+181: tmp = t_1 - ((a * b) * 0.25) elif (a * b) <= 2e+219: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) t_2 = Float64(c + Float64(Float64(x * y) + t_1)) t_3 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (Float64(a * b) <= -5e+154) tmp = t_3; elseif (Float64(a * b) <= 5e+30) tmp = t_2; elseif (Float64(a * b) <= 5e+181) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 2e+219) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; t_2 = c + ((x * y) + t_1); t_3 = c + (a * (b * -0.25)); tmp = 0.0; if ((a * b) <= -5e+154) tmp = t_3; elseif ((a * b) <= 5e+30) tmp = t_2; elseif ((a * b) <= 5e+181) tmp = t_1 - ((a * b) * 0.25); elseif ((a * b) <= 2e+219) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+154], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 5e+30], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 5e+181], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+219], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
t_2 := c + \left(x \cdot y + t\_1\right)\\
t_3 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+181}:\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+219}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000004e154 or 1.99999999999999993e219 < (*.f64 a b) Initial program 93.0%
Taylor expanded in a around inf 81.1%
*-commutative81.1%
associate-*r*81.1%
Simplified81.1%
if -5.00000000000000004e154 < (*.f64 a b) < 4.9999999999999998e30 or 5.0000000000000003e181 < (*.f64 a b) < 1.99999999999999993e219Initial program 97.6%
Taylor expanded in a around 0 94.6%
if 4.9999999999999998e30 < (*.f64 a b) < 5.0000000000000003e181Initial program 95.0%
Taylor expanded in x around 0 92.5%
+-commutative92.5%
associate-*r*92.5%
fma-def92.5%
Applied egg-rr92.5%
Taylor expanded in c around 0 83.1%
Final simplification90.0%
(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)))))
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);
}
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);
}
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) 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 * y)); 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); 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 * y), $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 + x \cdot y\\
\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%
+-commutative0.0%
associate-/l*0.0%
associate-/r/0.0%
fma-def30.0%
div-inv30.0%
metadata-eval30.0%
Applied egg-rr30.0%
Taylor expanded in x around inf 60.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625))
(t_2 (* (* a b) 0.25))
(t_3 (- (+ c t_1) t_2)))
(if (<= (* a b) -2e+136)
t_3
(if (<= (* a b) 5e+30)
(+ c (+ (* x y) t_1))
(if (<= (* a b) 5e+170) t_3 (- (+ c (* x y)) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double t_2 = (a * b) * 0.25;
double t_3 = (c + t_1) - t_2;
double tmp;
if ((a * b) <= -2e+136) {
tmp = t_3;
} else if ((a * b) <= 5e+30) {
tmp = c + ((x * y) + t_1);
} else if ((a * b) <= 5e+170) {
tmp = t_3;
} else {
tmp = (c + (x * y)) - 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) :: t_3
real(8) :: tmp
t_1 = (z * t) * 0.0625d0
t_2 = (a * b) * 0.25d0
t_3 = (c + t_1) - t_2
if ((a * b) <= (-2d+136)) then
tmp = t_3
else if ((a * b) <= 5d+30) then
tmp = c + ((x * y) + t_1)
else if ((a * b) <= 5d+170) then
tmp = t_3
else
tmp = (c + (x * y)) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double t_2 = (a * b) * 0.25;
double t_3 = (c + t_1) - t_2;
double tmp;
if ((a * b) <= -2e+136) {
tmp = t_3;
} else if ((a * b) <= 5e+30) {
tmp = c + ((x * y) + t_1);
} else if ((a * b) <= 5e+170) {
tmp = t_3;
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 t_2 = (a * b) * 0.25 t_3 = (c + t_1) - t_2 tmp = 0 if (a * b) <= -2e+136: tmp = t_3 elif (a * b) <= 5e+30: tmp = c + ((x * y) + t_1) elif (a * b) <= 5e+170: tmp = t_3 else: tmp = (c + (x * y)) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) t_2 = Float64(Float64(a * b) * 0.25) t_3 = Float64(Float64(c + t_1) - t_2) tmp = 0.0 if (Float64(a * b) <= -2e+136) tmp = t_3; elseif (Float64(a * b) <= 5e+30) tmp = Float64(c + Float64(Float64(x * y) + t_1)); elseif (Float64(a * b) <= 5e+170) tmp = t_3; else tmp = Float64(Float64(c + Float64(x * y)) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; t_2 = (a * b) * 0.25; t_3 = (c + t_1) - t_2; tmp = 0.0; if ((a * b) <= -2e+136) tmp = t_3; elseif ((a * b) <= 5e+30) tmp = c + ((x * y) + t_1); elseif ((a * b) <= 5e+170) tmp = t_3; else tmp = (c + (x * y)) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+136], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 5e+30], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+170], t$95$3, N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
t_2 := \left(a \cdot b\right) \cdot 0.25\\
t_3 := \left(c + t\_1\right) - t\_2\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+136}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+30}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000012e136 or 4.9999999999999998e30 < (*.f64 a b) < 4.99999999999999977e170Initial program 93.3%
Taylor expanded in x around 0 90.9%
if -2.00000000000000012e136 < (*.f64 a b) < 4.9999999999999998e30Initial program 97.4%
Taylor expanded in a around 0 94.9%
if 4.99999999999999977e170 < (*.f64 a b) Initial program 95.1%
Taylor expanded in z around 0 90.5%
Final simplification93.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (+ c (* a (* b -0.25)))))
(if (<= b -5.5e-112)
t_2
(if (<= b 2.6e-110)
t_1
(if (<= b 3e-31)
(+ c (* (* z t) 0.0625))
(if (<= b 7.6e+89) 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 = c + (a * (b * -0.25));
double tmp;
if (b <= -5.5e-112) {
tmp = t_2;
} else if (b <= 2.6e-110) {
tmp = t_1;
} else if (b <= 3e-31) {
tmp = c + ((z * t) * 0.0625);
} else if (b <= 7.6e+89) {
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 = c + (a * (b * (-0.25d0)))
if (b <= (-5.5d-112)) then
tmp = t_2
else if (b <= 2.6d-110) then
tmp = t_1
else if (b <= 3d-31) then
tmp = c + ((z * t) * 0.0625d0)
else if (b <= 7.6d+89) 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 = c + (a * (b * -0.25));
double tmp;
if (b <= -5.5e-112) {
tmp = t_2;
} else if (b <= 2.6e-110) {
tmp = t_1;
} else if (b <= 3e-31) {
tmp = c + ((z * t) * 0.0625);
} else if (b <= 7.6e+89) {
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 = c + (a * (b * -0.25)) tmp = 0 if b <= -5.5e-112: tmp = t_2 elif b <= 2.6e-110: tmp = t_1 elif b <= 3e-31: tmp = c + ((z * t) * 0.0625) elif b <= 7.6e+89: 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(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (b <= -5.5e-112) tmp = t_2; elseif (b <= 2.6e-110) tmp = t_1; elseif (b <= 3e-31) tmp = Float64(c + Float64(Float64(z * t) * 0.0625)); elseif (b <= 7.6e+89) 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 = c + (a * (b * -0.25)); tmp = 0.0; if (b <= -5.5e-112) tmp = t_2; elseif (b <= 2.6e-110) tmp = t_1; elseif (b <= 3e-31) tmp = c + ((z * t) * 0.0625); elseif (b <= 7.6e+89) 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[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.5e-112], t$95$2, If[LessEqual[b, 2.6e-110], t$95$1, If[LessEqual[b, 3e-31], N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.6e+89], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -5.5 \cdot 10^{-112}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-31}:\\
\;\;\;\;c + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{elif}\;b \leq 7.6 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -5.5e-112 or 7.60000000000000047e89 < b Initial program 94.6%
Taylor expanded in a around inf 60.9%
*-commutative60.9%
associate-*r*60.9%
Simplified60.9%
if -5.5e-112 < b < 2.5999999999999999e-110 or 2.99999999999999981e-31 < b < 7.60000000000000047e89Initial program 97.0%
+-commutative97.0%
associate-/l*96.9%
associate-/r/97.0%
fma-def98.0%
div-inv98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Taylor expanded in x around inf 69.3%
if 2.5999999999999999e-110 < b < 2.99999999999999981e-31Initial program 100.0%
+-commutative100.0%
associate-/l*99.9%
associate-/r/100.0%
fma-def100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 61.5%
Final simplification64.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+71) (not (<= (* a b) 5e-7))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+71) || !((a * b) <= 5e-7)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + ((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) :: tmp
if (((a * b) <= (-5d+71)) .or. (.not. ((a * b) <= 5d-7))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + ((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 tmp;
if (((a * b) <= -5e+71) || !((a * b) <= 5e-7)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+71) or not ((a * b) <= 5e-7): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+71) || !(Float64(a * b) <= 5e-7)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+71) || ~(((a * b) <= 5e-7))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+71], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e-7]], $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[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+71} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{-7}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999972e71 or 4.99999999999999977e-7 < (*.f64 a b) Initial program 94.9%
Taylor expanded in z around 0 85.3%
if -4.99999999999999972e71 < (*.f64 a b) < 4.99999999999999977e-7Initial program 97.1%
Taylor expanded in a around 0 95.7%
Final simplification91.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -4.2e+24) (not (<= b 8.8e+89))) (+ c (* a (* b -0.25))) (+ c (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -4.2e+24) || !(b <= 8.8e+89)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + ((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) :: tmp
if ((b <= (-4.2d+24)) .or. (.not. (b <= 8.8d+89))) then
tmp = c + (a * (b * (-0.25d0)))
else
tmp = c + ((x * y) + ((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 tmp;
if ((b <= -4.2e+24) || !(b <= 8.8e+89)) {
tmp = c + (a * (b * -0.25));
} else {
tmp = c + ((x * y) + ((z * t) * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -4.2e+24) or not (b <= 8.8e+89): tmp = c + (a * (b * -0.25)) else: tmp = c + ((x * y) + ((z * t) * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -4.2e+24) || !(b <= 8.8e+89)) tmp = Float64(c + Float64(a * Float64(b * -0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -4.2e+24) || ~((b <= 8.8e+89))) tmp = c + (a * (b * -0.25)); else tmp = c + ((x * y) + ((z * t) * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -4.2e+24], N[Not[LessEqual[b, 8.8e+89]], $MachinePrecision]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{+24} \lor \neg \left(b \leq 8.8 \cdot 10^{+89}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if b < -4.2000000000000003e24 or 8.8000000000000001e89 < b Initial program 92.6%
Taylor expanded in a around inf 68.0%
*-commutative68.0%
associate-*r*68.0%
Simplified68.0%
if -4.2000000000000003e24 < b < 8.8000000000000001e89Initial program 98.1%
Taylor expanded in a around 0 86.0%
Final simplification79.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= a -3e+95)
t_1
(if (<= a -7e-240) (* t (* z 0.0625)) (if (<= a 5.2e-101) 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 (a <= -3e+95) {
tmp = t_1;
} else if (a <= -7e-240) {
tmp = t * (z * 0.0625);
} else if (a <= 5.2e-101) {
tmp = c;
} 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 (a <= (-3d+95)) then
tmp = t_1
else if (a <= (-7d-240)) then
tmp = t * (z * 0.0625d0)
else if (a <= 5.2d-101) then
tmp = c
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 (a <= -3e+95) {
tmp = t_1;
} else if (a <= -7e-240) {
tmp = t * (z * 0.0625);
} else if (a <= 5.2e-101) {
tmp = c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) tmp = 0 if a <= -3e+95: tmp = t_1 elif a <= -7e-240: tmp = t * (z * 0.0625) elif a <= 5.2e-101: tmp = c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (a <= -3e+95) tmp = t_1; elseif (a <= -7e-240) tmp = Float64(t * Float64(z * 0.0625)); elseif (a <= 5.2e-101) tmp = c; 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 (a <= -3e+95) tmp = t_1; elseif (a <= -7e-240) tmp = t * (z * 0.0625); elseif (a <= 5.2e-101) tmp = c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3e+95], t$95$1, If[LessEqual[a, -7e-240], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e-101], c, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;a \leq -3 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7 \cdot 10^{-240}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-101}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.99999999999999991e95 or 5.2000000000000002e-101 < a Initial program 95.5%
Taylor expanded in x around 0 75.2%
+-commutative75.2%
associate-*r*75.2%
fma-def75.2%
Applied egg-rr75.2%
Taylor expanded in a around inf 43.9%
associate-*r*43.9%
*-commutative43.9%
*-commutative43.9%
Simplified43.9%
if -2.99999999999999991e95 < a < -7.00000000000000032e-240Initial program 97.0%
Taylor expanded in x around 0 74.7%
+-commutative74.7%
associate-*r*74.7%
fma-def74.7%
Applied egg-rr74.7%
Taylor expanded in c around 0 47.7%
Taylor expanded in t around inf 35.2%
*-commutative35.2%
associate-*l*35.2%
*-commutative35.2%
Simplified35.2%
if -7.00000000000000032e-240 < a < 5.2000000000000002e-101Initial program 96.3%
Taylor expanded in c around inf 32.6%
Final simplification39.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -1.25e-38) (not (<= t 9e+84))) (+ c (* (* z t) 0.0625)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.25e-38) || !(t <= 9e+84)) {
tmp = c + ((z * t) * 0.0625);
} 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 ((t <= (-1.25d-38)) .or. (.not. (t <= 9d+84))) then
tmp = c + ((z * t) * 0.0625d0)
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 ((t <= -1.25e-38) || !(t <= 9e+84)) {
tmp = c + ((z * t) * 0.0625);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -1.25e-38) or not (t <= 9e+84): tmp = c + ((z * t) * 0.0625) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -1.25e-38) || !(t <= 9e+84)) tmp = Float64(c + Float64(Float64(z * t) * 0.0625)); 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 ((t <= -1.25e-38) || ~((t <= 9e+84))) tmp = c + ((z * t) * 0.0625); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -1.25e-38], N[Not[LessEqual[t, 9e+84]], $MachinePrecision]], N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-38} \lor \neg \left(t \leq 9 \cdot 10^{+84}\right):\\
\;\;\;\;c + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if t < -1.25000000000000008e-38 or 8.9999999999999994e84 < t Initial program 94.1%
+-commutative94.1%
associate-/l*94.0%
associate-/r/94.1%
fma-def96.6%
div-inv96.6%
metadata-eval96.6%
Applied egg-rr96.6%
Taylor expanded in z around inf 57.9%
if -1.25000000000000008e-38 < t < 8.9999999999999994e84Initial program 97.8%
+-commutative97.8%
associate-/l*97.8%
associate-/r/97.8%
fma-def97.8%
div-inv97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in x around inf 63.4%
Final simplification60.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -6.7e+40) (not (<= a 4.9e-101))) (* b (* a -0.25)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -6.7e+40) || !(a <= 4.9e-101)) {
tmp = b * (a * -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 ((a <= (-6.7d+40)) .or. (.not. (a <= 4.9d-101))) then
tmp = b * (a * (-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 ((a <= -6.7e+40) || !(a <= 4.9e-101)) {
tmp = b * (a * -0.25);
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -6.7e+40) or not (a <= 4.9e-101): tmp = b * (a * -0.25) else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -6.7e+40) || !(a <= 4.9e-101)) tmp = Float64(b * Float64(a * -0.25)); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a <= -6.7e+40) || ~((a <= 4.9e-101))) tmp = b * (a * -0.25); else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -6.7e+40], N[Not[LessEqual[a, 4.9e-101]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.7 \cdot 10^{+40} \lor \neg \left(a \leq 4.9 \cdot 10^{-101}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if a < -6.70000000000000022e40 or 4.9e-101 < a Initial program 95.2%
Taylor expanded in x around 0 75.8%
+-commutative75.8%
associate-*r*75.8%
fma-def75.8%
Applied egg-rr75.8%
Taylor expanded in a around inf 42.8%
associate-*r*42.8%
*-commutative42.8%
*-commutative42.8%
Simplified42.8%
if -6.70000000000000022e40 < a < 4.9e-101Initial program 97.3%
Taylor expanded in c around inf 31.7%
Final simplification38.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -1.25e-38) (not (<= t 1.6e+85))) (* t (* z 0.0625)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.25e-38) || !(t <= 1.6e+85)) {
tmp = t * (z * 0.0625);
} 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 ((t <= (-1.25d-38)) .or. (.not. (t <= 1.6d+85))) then
tmp = t * (z * 0.0625d0)
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 ((t <= -1.25e-38) || !(t <= 1.6e+85)) {
tmp = t * (z * 0.0625);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -1.25e-38) or not (t <= 1.6e+85): tmp = t * (z * 0.0625) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -1.25e-38) || !(t <= 1.6e+85)) tmp = Float64(t * Float64(z * 0.0625)); 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 ((t <= -1.25e-38) || ~((t <= 1.6e+85))) tmp = t * (z * 0.0625); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -1.25e-38], N[Not[LessEqual[t, 1.6e+85]], $MachinePrecision]], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-38} \lor \neg \left(t \leq 1.6 \cdot 10^{+85}\right):\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if t < -1.25000000000000008e-38 or 1.60000000000000009e85 < t Initial program 94.1%
Taylor expanded in x around 0 77.4%
+-commutative77.4%
associate-*r*77.4%
fma-def77.4%
Applied egg-rr77.4%
Taylor expanded in c around 0 64.1%
Taylor expanded in t around inf 44.4%
*-commutative44.4%
associate-*l*44.4%
*-commutative44.4%
Simplified44.4%
if -1.25000000000000008e-38 < t < 1.60000000000000009e85Initial program 97.8%
+-commutative97.8%
associate-/l*97.8%
associate-/r/97.8%
fma-def97.8%
div-inv97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in x around inf 63.4%
Final simplification54.6%
(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.1%
Taylor expanded in c around inf 23.6%
Final simplification23.6%
herbie shell --seed 2024036
(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))