
(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 (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.0%
fma-neg98.8%
neg-sub098.8%
associate-+l-98.8%
neg-sub098.8%
+-commutative98.8%
unsub-neg98.8%
*-commutative98.8%
associate-*r/98.8%
Simplified98.8%
Final simplification98.8%
(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 (* 0.0625 (* t z))))))
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, (0.0625 * (t * z)));
}
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, Float64(0.0625 * Float64(t * z))); 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[(0.0625 * N[(t * z), $MachinePrecision]), $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, 0.0625 \cdot \left(t \cdot z\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 a around 0 14.3%
Taylor expanded in c around 0 14.3%
fma-def57.1%
Applied egg-rr57.1%
Final simplification98.8%
(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-def98.4%
associate-/l*98.4%
metadata-eval98.4%
*-lft-identity98.4%
associate-/l*98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625)))) (t_2 (+ c (* b (* a -0.25)))))
(if (<= (* b a) -5e+159)
t_2
(if (<= (* b a) -1e-21)
t_1
(if (<= (* b a) -2e-68)
(+ c (* x y))
(if (<= (* b a) 1e-150)
t_1
(if (<= (* b a) 2e+149) (+ (* 0.0625 (* t z)) (* x y)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (b * (a * -0.25));
double tmp;
if ((b * a) <= -5e+159) {
tmp = t_2;
} else if ((b * a) <= -1e-21) {
tmp = t_1;
} else if ((b * a) <= -2e-68) {
tmp = c + (x * y);
} else if ((b * a) <= 1e-150) {
tmp = t_1;
} else if ((b * a) <= 2e+149) {
tmp = (0.0625 * (t * z)) + (x * y);
} 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 + (z * (t * 0.0625d0))
t_2 = c + (b * (a * (-0.25d0)))
if ((b * a) <= (-5d+159)) then
tmp = t_2
else if ((b * a) <= (-1d-21)) then
tmp = t_1
else if ((b * a) <= (-2d-68)) then
tmp = c + (x * y)
else if ((b * a) <= 1d-150) then
tmp = t_1
else if ((b * a) <= 2d+149) then
tmp = (0.0625d0 * (t * z)) + (x * y)
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 + (z * (t * 0.0625));
double t_2 = c + (b * (a * -0.25));
double tmp;
if ((b * a) <= -5e+159) {
tmp = t_2;
} else if ((b * a) <= -1e-21) {
tmp = t_1;
} else if ((b * a) <= -2e-68) {
tmp = c + (x * y);
} else if ((b * a) <= 1e-150) {
tmp = t_1;
} else if ((b * a) <= 2e+149) {
tmp = (0.0625 * (t * z)) + (x * y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (z * (t * 0.0625)) t_2 = c + (b * (a * -0.25)) tmp = 0 if (b * a) <= -5e+159: tmp = t_2 elif (b * a) <= -1e-21: tmp = t_1 elif (b * a) <= -2e-68: tmp = c + (x * y) elif (b * a) <= 1e-150: tmp = t_1 elif (b * a) <= 2e+149: tmp = (0.0625 * (t * z)) + (x * y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) t_2 = Float64(c + Float64(b * Float64(a * -0.25))) tmp = 0.0 if (Float64(b * a) <= -5e+159) tmp = t_2; elseif (Float64(b * a) <= -1e-21) tmp = t_1; elseif (Float64(b * a) <= -2e-68) tmp = Float64(c + Float64(x * y)); elseif (Float64(b * a) <= 1e-150) tmp = t_1; elseif (Float64(b * a) <= 2e+149) tmp = Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (z * (t * 0.0625)); t_2 = c + (b * (a * -0.25)); tmp = 0.0; if ((b * a) <= -5e+159) tmp = t_2; elseif ((b * a) <= -1e-21) tmp = t_1; elseif ((b * a) <= -2e-68) tmp = c + (x * y); elseif ((b * a) <= 1e-150) tmp = t_1; elseif ((b * a) <= 2e+149) tmp = (0.0625 * (t * z)) + (x * y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5e+159], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -1e-21], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -2e-68], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 1e-150], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 2e+149], N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+159}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-68}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;b \cdot a \leq 10^{-150}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+149}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right) + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000003e159 or 2.0000000000000001e149 < (*.f64 a b) Initial program 92.8%
Taylor expanded in a around inf 85.9%
*-commutative85.9%
*-commutative85.9%
associate-*r*85.9%
Simplified85.9%
if -5.00000000000000003e159 < (*.f64 a b) < -9.99999999999999908e-22 or -2.00000000000000013e-68 < (*.f64 a b) < 1.00000000000000001e-150Initial program 99.2%
Taylor expanded in z around inf 71.1%
*-commutative71.1%
associate-*r*71.1%
*-commutative71.1%
associate-*l*71.1%
Simplified71.1%
if -9.99999999999999908e-22 < (*.f64 a b) < -2.00000000000000013e-68Initial program 100.0%
Taylor expanded in x around inf 84.2%
if 1.00000000000000001e-150 < (*.f64 a b) < 2.0000000000000001e149Initial program 98.1%
Taylor expanded in a around 0 83.1%
Taylor expanded in c around 0 73.8%
Final simplification76.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -5e+159) (not (<= (* b a) 2e+149))) (+ c (* b (* a -0.25))) (+ c (+ (* 0.0625 (* t z)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+159) || !((b * a) <= 2e+149)) {
tmp = c + (b * (a * -0.25));
} else {
tmp = c + ((0.0625 * (t * z)) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((b * a) <= (-5d+159)) .or. (.not. ((b * a) <= 2d+149))) then
tmp = c + (b * (a * (-0.25d0)))
else
tmp = c + ((0.0625d0 * (t * z)) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+159) || !((b * a) <= 2e+149)) {
tmp = c + (b * (a * -0.25));
} else {
tmp = c + ((0.0625 * (t * z)) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -5e+159) or not ((b * a) <= 2e+149): tmp = c + (b * (a * -0.25)) else: tmp = c + ((0.0625 * (t * z)) + (x * y)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -5e+159) || !(Float64(b * a) <= 2e+149)) tmp = Float64(c + Float64(b * Float64(a * -0.25))); else tmp = Float64(c + Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -5e+159) || ~(((b * a) <= 2e+149))) tmp = c + (b * (a * -0.25)); else tmp = c + ((0.0625 * (t * z)) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -5e+159], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+149]], $MachinePrecision]], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+159} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+149}\right):\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000003e159 or 2.0000000000000001e149 < (*.f64 a b) Initial program 92.8%
Taylor expanded in a around inf 85.9%
*-commutative85.9%
*-commutative85.9%
associate-*r*85.9%
Simplified85.9%
if -5.00000000000000003e159 < (*.f64 a b) < 2.0000000000000001e149Initial program 98.9%
Taylor expanded in a around 0 90.1%
Final simplification89.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -5e+159) (not (<= (* b a) 2e+130))) (- (+ c (* x y)) (* (* b a) 0.25)) (+ c (+ (* 0.0625 (* t z)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+159) || !((b * a) <= 2e+130)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((0.0625 * (t * z)) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((b * a) <= (-5d+159)) .or. (.not. ((b * a) <= 2d+130))) then
tmp = (c + (x * y)) - ((b * a) * 0.25d0)
else
tmp = c + ((0.0625d0 * (t * z)) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((b * a) <= -5e+159) || !((b * a) <= 2e+130)) {
tmp = (c + (x * y)) - ((b * a) * 0.25);
} else {
tmp = c + ((0.0625 * (t * z)) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((b * a) <= -5e+159) or not ((b * a) <= 2e+130): tmp = (c + (x * y)) - ((b * a) * 0.25) else: tmp = c + ((0.0625 * (t * z)) + (x * y)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(b * a) <= -5e+159) || !(Float64(b * a) <= 2e+130)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 0.25)); else tmp = Float64(c + Float64(Float64(0.0625 * Float64(t * z)) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((b * a) <= -5e+159) || ~(((b * a) <= 2e+130))) tmp = (c + (x * y)) - ((b * a) * 0.25); else tmp = c + ((0.0625 * (t * z)) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(b * a), $MachinePrecision], -5e+159], N[Not[LessEqual[N[(b * a), $MachinePrecision], 2e+130]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+159} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+130}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000003e159 or 2.0000000000000001e130 < (*.f64 a b) Initial program 93.0%
associate-+l-93.0%
sub-neg93.0%
neg-mul-193.0%
metadata-eval93.0%
metadata-eval93.0%
cancel-sign-sub-inv93.0%
fma-def94.4%
associate-/l*94.4%
metadata-eval94.4%
*-lft-identity94.4%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in z around 0 87.6%
if -5.00000000000000003e159 < (*.f64 a b) < 2.0000000000000001e130Initial program 98.9%
Taylor expanded in a around 0 90.6%
Final simplification89.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))))
(if (<= y -7e+36)
(* x y)
(if (<= y -3.1e-58)
t_1
(if (<= y -1.7e-301)
c
(if (<= y 1.8e-20)
t_1
(if (<= y 4.2e+29) c (if (<= y 4.8e+149) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if (y <= -7e+36) {
tmp = x * y;
} else if (y <= -3.1e-58) {
tmp = t_1;
} else if (y <= -1.7e-301) {
tmp = c;
} else if (y <= 1.8e-20) {
tmp = t_1;
} else if (y <= 4.2e+29) {
tmp = c;
} else if (y <= 4.8e+149) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (t * z)
if (y <= (-7d+36)) then
tmp = x * y
else if (y <= (-3.1d-58)) then
tmp = t_1
else if (y <= (-1.7d-301)) then
tmp = c
else if (y <= 1.8d-20) then
tmp = t_1
else if (y <= 4.2d+29) then
tmp = c
else if (y <= 4.8d+149) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if (y <= -7e+36) {
tmp = x * y;
} else if (y <= -3.1e-58) {
tmp = t_1;
} else if (y <= -1.7e-301) {
tmp = c;
} else if (y <= 1.8e-20) {
tmp = t_1;
} else if (y <= 4.2e+29) {
tmp = c;
} else if (y <= 4.8e+149) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) tmp = 0 if y <= -7e+36: tmp = x * y elif y <= -3.1e-58: tmp = t_1 elif y <= -1.7e-301: tmp = c elif y <= 1.8e-20: tmp = t_1 elif y <= 4.2e+29: tmp = c elif y <= 4.8e+149: tmp = t_1 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 (y <= -7e+36) tmp = Float64(x * y); elseif (y <= -3.1e-58) tmp = t_1; elseif (y <= -1.7e-301) tmp = c; elseif (y <= 1.8e-20) tmp = t_1; elseif (y <= 4.2e+29) tmp = c; elseif (y <= 4.8e+149) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (t * z); tmp = 0.0; if (y <= -7e+36) tmp = x * y; elseif (y <= -3.1e-58) tmp = t_1; elseif (y <= -1.7e-301) tmp = c; elseif (y <= 1.8e-20) tmp = t_1; elseif (y <= 4.2e+29) tmp = c; elseif (y <= 4.8e+149) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+36], N[(x * y), $MachinePrecision], If[LessEqual[y, -3.1e-58], t$95$1, If[LessEqual[y, -1.7e-301], c, If[LessEqual[y, 1.8e-20], t$95$1, If[LessEqual[y, 4.2e+29], c, If[LessEqual[y, 4.8e+149], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;y \leq -7 \cdot 10^{+36}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{-58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-301}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+29}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+149}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -6.9999999999999996e36 or 4.80000000000000024e149 < y Initial program 93.3%
Taylor expanded in a around 0 75.0%
Taylor expanded in c around 0 63.4%
Taylor expanded in y around inf 45.0%
if -6.9999999999999996e36 < y < -3.0999999999999999e-58 or -1.7000000000000001e-301 < y < 1.79999999999999987e-20 or 4.2000000000000003e29 < y < 4.80000000000000024e149Initial program 99.0%
Taylor expanded in a around 0 71.9%
Taylor expanded in c around 0 50.9%
Taylor expanded in y around 0 39.0%
if -3.0999999999999999e-58 < y < -1.7000000000000001e-301 or 1.79999999999999987e-20 < y < 4.2000000000000003e29Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.9%
metadata-eval99.9%
*-lft-identity99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in c around inf 37.9%
Final simplification40.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))))
(if (<= y -1.85e+35)
(* x y)
(if (<= y -7e-69)
t_1
(if (<= y -1.6e-196)
(* b (* a -0.25))
(if (<= y 1.05e-19)
t_1
(if (<= y 4.5e+28) c (if (<= y 5e+149) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if (y <= -1.85e+35) {
tmp = x * y;
} else if (y <= -7e-69) {
tmp = t_1;
} else if (y <= -1.6e-196) {
tmp = b * (a * -0.25);
} else if (y <= 1.05e-19) {
tmp = t_1;
} else if (y <= 4.5e+28) {
tmp = c;
} else if (y <= 5e+149) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (t * z)
if (y <= (-1.85d+35)) then
tmp = x * y
else if (y <= (-7d-69)) then
tmp = t_1
else if (y <= (-1.6d-196)) then
tmp = b * (a * (-0.25d0))
else if (y <= 1.05d-19) then
tmp = t_1
else if (y <= 4.5d+28) then
tmp = c
else if (y <= 5d+149) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if (y <= -1.85e+35) {
tmp = x * y;
} else if (y <= -7e-69) {
tmp = t_1;
} else if (y <= -1.6e-196) {
tmp = b * (a * -0.25);
} else if (y <= 1.05e-19) {
tmp = t_1;
} else if (y <= 4.5e+28) {
tmp = c;
} else if (y <= 5e+149) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) tmp = 0 if y <= -1.85e+35: tmp = x * y elif y <= -7e-69: tmp = t_1 elif y <= -1.6e-196: tmp = b * (a * -0.25) elif y <= 1.05e-19: tmp = t_1 elif y <= 4.5e+28: tmp = c elif y <= 5e+149: tmp = t_1 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 (y <= -1.85e+35) tmp = Float64(x * y); elseif (y <= -7e-69) tmp = t_1; elseif (y <= -1.6e-196) tmp = Float64(b * Float64(a * -0.25)); elseif (y <= 1.05e-19) tmp = t_1; elseif (y <= 4.5e+28) tmp = c; elseif (y <= 5e+149) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (t * z); tmp = 0.0; if (y <= -1.85e+35) tmp = x * y; elseif (y <= -7e-69) tmp = t_1; elseif (y <= -1.6e-196) tmp = b * (a * -0.25); elseif (y <= 1.05e-19) tmp = t_1; elseif (y <= 4.5e+28) tmp = c; elseif (y <= 5e+149) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+35], N[(x * y), $MachinePrecision], If[LessEqual[y, -7e-69], t$95$1, If[LessEqual[y, -1.6e-196], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-19], t$95$1, If[LessEqual[y, 4.5e+28], c, If[LessEqual[y, 5e+149], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+35}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-196}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+28}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+149}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -1.85e35 or 4.9999999999999999e149 < y Initial program 93.4%
Taylor expanded in a around 0 75.2%
Taylor expanded in c around 0 63.8%
Taylor expanded in y around inf 44.6%
if -1.85e35 < y < -7.0000000000000003e-69 or -1.6e-196 < y < 1.0499999999999999e-19 or 4.4999999999999997e28 < y < 4.9999999999999999e149Initial program 99.2%
Taylor expanded in a around 0 73.9%
Taylor expanded in c around 0 47.0%
Taylor expanded in y around 0 37.6%
if -7.0000000000000003e-69 < y < -1.6e-196Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*100.0%
metadata-eval100.0%
*-lft-identity100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 73.7%
Taylor expanded in c around 0 52.2%
Taylor expanded in y around 0 40.4%
associate-*r*40.4%
Simplified40.4%
if 1.0499999999999999e-19 < y < 4.4999999999999997e28Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in c around inf 57.2%
Final simplification41.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* b (* a -0.25)))) (t_2 (* 0.0625 (* t z))))
(if (<= z -2.45e+164)
t_2
(if (<= z -3.4e-50)
(+ c (* x y))
(if (<= z -2e-206)
t_1
(if (<= z -1.3e-236) (* x y) (if (<= z 7e+15) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double t_2 = 0.0625 * (t * z);
double tmp;
if (z <= -2.45e+164) {
tmp = t_2;
} else if (z <= -3.4e-50) {
tmp = c + (x * y);
} else if (z <= -2e-206) {
tmp = t_1;
} else if (z <= -1.3e-236) {
tmp = x * y;
} else if (z <= 7e+15) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (b * (a * (-0.25d0)))
t_2 = 0.0625d0 * (t * z)
if (z <= (-2.45d+164)) then
tmp = t_2
else if (z <= (-3.4d-50)) then
tmp = c + (x * y)
else if (z <= (-2d-206)) then
tmp = t_1
else if (z <= (-1.3d-236)) then
tmp = x * y
else if (z <= 7d+15) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double t_2 = 0.0625 * (t * z);
double tmp;
if (z <= -2.45e+164) {
tmp = t_2;
} else if (z <= -3.4e-50) {
tmp = c + (x * y);
} else if (z <= -2e-206) {
tmp = t_1;
} else if (z <= -1.3e-236) {
tmp = x * y;
} else if (z <= 7e+15) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (b * (a * -0.25)) t_2 = 0.0625 * (t * z) tmp = 0 if z <= -2.45e+164: tmp = t_2 elif z <= -3.4e-50: tmp = c + (x * y) elif z <= -2e-206: tmp = t_1 elif z <= -1.3e-236: tmp = x * y elif z <= 7e+15: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(b * Float64(a * -0.25))) t_2 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (z <= -2.45e+164) tmp = t_2; elseif (z <= -3.4e-50) tmp = Float64(c + Float64(x * y)); elseif (z <= -2e-206) tmp = t_1; elseif (z <= -1.3e-236) tmp = Float64(x * y); elseif (z <= 7e+15) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (b * (a * -0.25)); t_2 = 0.0625 * (t * z); tmp = 0.0; if (z <= -2.45e+164) tmp = t_2; elseif (z <= -3.4e-50) tmp = c + (x * y); elseif (z <= -2e-206) tmp = t_1; elseif (z <= -1.3e-236) tmp = x * y; elseif (z <= 7e+15) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+164], t$95$2, If[LessEqual[z, -3.4e-50], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2e-206], t$95$1, If[LessEqual[z, -1.3e-236], N[(x * y), $MachinePrecision], If[LessEqual[z, 7e+15], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
t_2 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+164}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-50}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-236}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.4499999999999999e164 or 7e15 < z Initial program 96.2%
Taylor expanded in a around 0 78.6%
Taylor expanded in c around 0 64.0%
Taylor expanded in y around 0 56.3%
if -2.4499999999999999e164 < z < -3.40000000000000014e-50Initial program 97.7%
Taylor expanded in x around inf 61.7%
if -3.40000000000000014e-50 < z < -2.00000000000000006e-206 or -1.3e-236 < z < 7e15Initial program 98.1%
Taylor expanded in a around inf 62.4%
*-commutative62.4%
*-commutative62.4%
associate-*r*62.4%
Simplified62.4%
if -2.00000000000000006e-206 < z < -1.3e-236Initial program 100.0%
Taylor expanded in a around 0 52.2%
Taylor expanded in c around 0 50.9%
Taylor expanded in y around inf 26.4%
Final simplification59.2%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c + ((((t * z) / 16.0d0) + (x * y)) - ((b * a) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + ((((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\right)
\end{array}
Initial program 97.3%
Final simplification97.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* t z))))
(if (<= z -1.22e+166)
t_1
(if (<= z 1.2e-173)
(+ c (* x y))
(if (<= z 1.85e-39) (* b (* a -0.25)) t_1)))))
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 (z <= -1.22e+166) {
tmp = t_1;
} else if (z <= 1.2e-173) {
tmp = c + (x * y);
} else if (z <= 1.85e-39) {
tmp = b * (a * -0.25);
} 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 = 0.0625d0 * (t * z)
if (z <= (-1.22d+166)) then
tmp = t_1
else if (z <= 1.2d-173) then
tmp = c + (x * y)
else if (z <= 1.85d-39) then
tmp = b * (a * (-0.25d0))
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 = 0.0625 * (t * z);
double tmp;
if (z <= -1.22e+166) {
tmp = t_1;
} else if (z <= 1.2e-173) {
tmp = c + (x * y);
} else if (z <= 1.85e-39) {
tmp = b * (a * -0.25);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (t * z) tmp = 0 if z <= -1.22e+166: tmp = t_1 elif z <= 1.2e-173: tmp = c + (x * y) elif z <= 1.85e-39: tmp = b * (a * -0.25) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (z <= -1.22e+166) tmp = t_1; elseif (z <= 1.2e-173) tmp = Float64(c + Float64(x * y)); elseif (z <= 1.85e-39) tmp = Float64(b * Float64(a * -0.25)); else tmp = t_1; 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 (z <= -1.22e+166) tmp = t_1; elseif (z <= 1.2e-173) tmp = c + (x * y); elseif (z <= 1.85e-39) tmp = b * (a * -0.25); else tmp = t_1; 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[z, -1.22e+166], t$95$1, If[LessEqual[z, 1.2e-173], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-39], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-173}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-39}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.21999999999999993e166 or 1.85000000000000007e-39 < z Initial program 95.8%
Taylor expanded in a around 0 77.8%
Taylor expanded in c around 0 62.5%
Taylor expanded in y around 0 51.6%
if -1.21999999999999993e166 < z < 1.20000000000000008e-173Initial program 98.1%
Taylor expanded in x around inf 59.6%
if 1.20000000000000008e-173 < z < 1.85000000000000007e-39Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
neg-mul-1100.0%
metadata-eval100.0%
metadata-eval100.0%
cancel-sign-sub-inv100.0%
fma-def100.0%
associate-/l*100.0%
metadata-eval100.0%
*-lft-identity100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 95.3%
Taylor expanded in c around 0 75.2%
Taylor expanded in y around 0 49.7%
associate-*r*49.7%
Simplified49.7%
Final simplification54.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.3e+144) (not (<= z 1.02e-27))) (+ c (* z (* t 0.0625))) (+ c (* b (* a -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.3e+144) || !(z <= 1.02e-27)) {
tmp = c + (z * (t * 0.0625));
} 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 ((z <= (-1.3d+144)) .or. (.not. (z <= 1.02d-27))) then
tmp = c + (z * (t * 0.0625d0))
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 ((z <= -1.3e+144) || !(z <= 1.02e-27)) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.3e+144) or not (z <= 1.02e-27): tmp = c + (z * (t * 0.0625)) else: tmp = c + (b * (a * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.3e+144) || !(z <= 1.02e-27)) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); 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 ((z <= -1.3e+144) || ~((z <= 1.02e-27))) tmp = c + (z * (t * 0.0625)); else tmp = c + (b * (a * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.3e+144], N[Not[LessEqual[z, 1.02e-27]], $MachinePrecision]], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+144} \lor \neg \left(z \leq 1.02 \cdot 10^{-27}\right):\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if z < -1.2999999999999999e144 or 1.02000000000000002e-27 < z Initial program 95.8%
Taylor expanded in z around inf 67.3%
*-commutative67.3%
associate-*r*67.3%
*-commutative67.3%
associate-*l*67.3%
Simplified67.3%
if -1.2999999999999999e144 < z < 1.02000000000000002e-27Initial program 98.5%
Taylor expanded in a around inf 61.1%
*-commutative61.1%
*-commutative61.1%
associate-*r*61.1%
Simplified61.1%
Final simplification64.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= y -4.2e+39) (* x y) (if (<= y 3.2e+96) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -4.2e+39) {
tmp = x * y;
} else if (y <= 3.2e+96) {
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 (y <= (-4.2d+39)) then
tmp = x * y
else if (y <= 3.2d+96) 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 (y <= -4.2e+39) {
tmp = x * y;
} else if (y <= 3.2e+96) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if y <= -4.2e+39: tmp = x * y elif y <= 3.2e+96: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -4.2e+39) tmp = Float64(x * y); elseif (y <= 3.2e+96) 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 (y <= -4.2e+39) tmp = x * y; elseif (y <= 3.2e+96) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -4.2e+39], N[(x * y), $MachinePrecision], If[LessEqual[y, 3.2e+96], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+39}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+96}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -4.1999999999999997e39 or 3.20000000000000006e96 < y Initial program 93.9%
Taylor expanded in a around 0 76.0%
Taylor expanded in c around 0 66.2%
Taylor expanded in y around inf 46.4%
if -4.1999999999999997e39 < y < 3.20000000000000006e96Initial program 99.4%
associate-+l-99.4%
sub-neg99.4%
neg-mul-199.4%
metadata-eval99.4%
metadata-eval99.4%
cancel-sign-sub-inv99.4%
fma-def99.4%
associate-/l*99.3%
metadata-eval99.3%
*-lft-identity99.3%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in c around inf 30.5%
Final simplification36.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 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-def98.4%
associate-/l*98.4%
metadata-eval98.4%
*-lft-identity98.4%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in c around inf 23.5%
Final simplification23.5%
herbie shell --seed 2023187
(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))