
(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 x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 99.6%
associate--l+99.6%
fma-define99.6%
associate-/l*99.6%
fma-neg100.0%
distribute-neg-frac2100.0%
metadata-eval100.0%
Simplified100.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))) (t_2 (* z (* t 0.0625))))
(if (<= (* x y) -1.9e+74)
(* x y)
(if (<= (* x y) -6.5e+30)
t_1
(if (<= (* x y) -2.8e-81)
c
(if (<= (* x y) -4.6e-271)
t_1
(if (<= (* x y) 2.2e-193)
t_2
(if (<= (* x y) 6.9e-37)
t_1
(if (<= (* x y) 2.2e-14) t_2 (* 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 t_2 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.9e+74) {
tmp = x * y;
} else if ((x * y) <= -6.5e+30) {
tmp = t_1;
} else if ((x * y) <= -2.8e-81) {
tmp = c;
} else if ((x * y) <= -4.6e-271) {
tmp = t_1;
} else if ((x * y) <= 2.2e-193) {
tmp = t_2;
} else if ((x * y) <= 6.9e-37) {
tmp = t_1;
} else if ((x * y) <= 2.2e-14) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = b * (a * (-0.25d0))
t_2 = z * (t * 0.0625d0)
if ((x * y) <= (-1.9d+74)) then
tmp = x * y
else if ((x * y) <= (-6.5d+30)) then
tmp = t_1
else if ((x * y) <= (-2.8d-81)) then
tmp = c
else if ((x * y) <= (-4.6d-271)) then
tmp = t_1
else if ((x * y) <= 2.2d-193) then
tmp = t_2
else if ((x * y) <= 6.9d-37) then
tmp = t_1
else if ((x * y) <= 2.2d-14) then
tmp = t_2
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 t_2 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.9e+74) {
tmp = x * y;
} else if ((x * y) <= -6.5e+30) {
tmp = t_1;
} else if ((x * y) <= -2.8e-81) {
tmp = c;
} else if ((x * y) <= -4.6e-271) {
tmp = t_1;
} else if ((x * y) <= 2.2e-193) {
tmp = t_2;
} else if ((x * y) <= 6.9e-37) {
tmp = t_1;
} else if ((x * y) <= 2.2e-14) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) t_2 = z * (t * 0.0625) tmp = 0 if (x * y) <= -1.9e+74: tmp = x * y elif (x * y) <= -6.5e+30: tmp = t_1 elif (x * y) <= -2.8e-81: tmp = c elif (x * y) <= -4.6e-271: tmp = t_1 elif (x * y) <= 2.2e-193: tmp = t_2 elif (x * y) <= 6.9e-37: tmp = t_1 elif (x * y) <= 2.2e-14: tmp = t_2 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) t_2 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -1.9e+74) tmp = Float64(x * y); elseif (Float64(x * y) <= -6.5e+30) tmp = t_1; elseif (Float64(x * y) <= -2.8e-81) tmp = c; elseif (Float64(x * y) <= -4.6e-271) tmp = t_1; elseif (Float64(x * y) <= 2.2e-193) tmp = t_2; elseif (Float64(x * y) <= 6.9e-37) tmp = t_1; elseif (Float64(x * y) <= 2.2e-14) tmp = t_2; 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); t_2 = z * (t * 0.0625); tmp = 0.0; if ((x * y) <= -1.9e+74) tmp = x * y; elseif ((x * y) <= -6.5e+30) tmp = t_1; elseif ((x * y) <= -2.8e-81) tmp = c; elseif ((x * y) <= -4.6e-271) tmp = t_1; elseif ((x * y) <= 2.2e-193) tmp = t_2; elseif ((x * y) <= 6.9e-37) tmp = t_1; elseif ((x * y) <= 2.2e-14) tmp = t_2; else tmp = x * y; 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]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.9e+74], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -6.5e+30], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-81], c, If[LessEqual[N[(x * y), $MachinePrecision], -4.6e-271], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-193], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 6.9e-37], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-14], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.9 \cdot 10^{+74}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -6.5 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-81}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq -4.6 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-193}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 6.9 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-14}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.8999999999999999e74 or 2.2000000000000001e-14 < (*.f64 x y) Initial program 100.0%
Taylor expanded in x around inf 73.0%
Taylor expanded in x around inf 66.7%
if -1.8999999999999999e74 < (*.f64 x y) < -6.5e30 or -2.7999999999999999e-81 < (*.f64 x y) < -4.60000000000000017e-271 or 2.19999999999999977e-193 < (*.f64 x y) < 6.8999999999999999e-37Initial program 98.5%
Taylor expanded in x around 0 97.1%
Taylor expanded in a around inf 53.1%
associate-*r*53.1%
*-commutative53.1%
*-commutative53.1%
Simplified53.1%
if -6.5e30 < (*.f64 x y) < -2.7999999999999999e-81Initial program 100.0%
Taylor expanded in c around inf 36.9%
if -4.60000000000000017e-271 < (*.f64 x y) < 2.19999999999999977e-193 or 6.8999999999999999e-37 < (*.f64 x y) < 2.2000000000000001e-14Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in t around inf 54.3%
associate-*r*54.3%
*-commutative54.3%
Simplified54.3%
Final simplification57.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t)))
(t_2 (* (* a b) 0.25))
(t_3 (- t_1 t_2))
(t_4 (- (* x y) t_2)))
(if (<= (* x y) -5e+30)
t_4
(if (<= (* x y) -5e-82)
(+ c t_1)
(if (<= (* x y) 1e-190)
t_3
(if (<= (* x y) 4e-83)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 1e-19) t_3 t_4)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (a * b) * 0.25;
double t_3 = t_1 - t_2;
double t_4 = (x * y) - t_2;
double tmp;
if ((x * y) <= -5e+30) {
tmp = t_4;
} else if ((x * y) <= -5e-82) {
tmp = c + t_1;
} else if ((x * y) <= 1e-190) {
tmp = t_3;
} else if ((x * y) <= 4e-83) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1e-19) {
tmp = t_3;
} else {
tmp = t_4;
}
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) :: t_4
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
t_2 = (a * b) * 0.25d0
t_3 = t_1 - t_2
t_4 = (x * y) - t_2
if ((x * y) <= (-5d+30)) then
tmp = t_4
else if ((x * y) <= (-5d-82)) then
tmp = c + t_1
else if ((x * y) <= 1d-190) then
tmp = t_3
else if ((x * y) <= 4d-83) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 1d-19) then
tmp = t_3
else
tmp = t_4
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 * (z * t);
double t_2 = (a * b) * 0.25;
double t_3 = t_1 - t_2;
double t_4 = (x * y) - t_2;
double tmp;
if ((x * y) <= -5e+30) {
tmp = t_4;
} else if ((x * y) <= -5e-82) {
tmp = c + t_1;
} else if ((x * y) <= 1e-190) {
tmp = t_3;
} else if ((x * y) <= 4e-83) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1e-19) {
tmp = t_3;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = (a * b) * 0.25 t_3 = t_1 - t_2 t_4 = (x * y) - t_2 tmp = 0 if (x * y) <= -5e+30: tmp = t_4 elif (x * y) <= -5e-82: tmp = c + t_1 elif (x * y) <= 1e-190: tmp = t_3 elif (x * y) <= 4e-83: tmp = c + (b * (a * -0.25)) elif (x * y) <= 1e-19: tmp = t_3 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(a * b) * 0.25) t_3 = Float64(t_1 - t_2) t_4 = Float64(Float64(x * y) - t_2) tmp = 0.0 if (Float64(x * y) <= -5e+30) tmp = t_4; elseif (Float64(x * y) <= -5e-82) tmp = Float64(c + t_1); elseif (Float64(x * y) <= 1e-190) tmp = t_3; elseif (Float64(x * y) <= 4e-83) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 1e-19) tmp = t_3; else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = (a * b) * 0.25; t_3 = t_1 - t_2; t_4 = (x * y) - t_2; tmp = 0.0; if ((x * y) <= -5e+30) tmp = t_4; elseif ((x * y) <= -5e-82) tmp = c + t_1; elseif ((x * y) <= 1e-190) tmp = t_3; elseif ((x * y) <= 4e-83) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 1e-19) tmp = t_3; else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+30], t$95$4, If[LessEqual[N[(x * y), $MachinePrecision], -5e-82], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-190], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 4e-83], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-19], t$95$3, t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := \left(a \cdot b\right) \cdot 0.25\\
t_3 := t\_1 - t\_2\\
t_4 := x \cdot y - t\_2\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+30}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-82}:\\
\;\;\;\;c + t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-190}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-83}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-19}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999998e30 or 9.9999999999999998e-20 < (*.f64 x y) Initial program 100.0%
Taylor expanded in z around 0 90.1%
Taylor expanded in y around inf 87.7%
Taylor expanded in x around inf 82.8%
if -4.9999999999999998e30 < (*.f64 x y) < -4.9999999999999998e-82Initial program 95.7%
Taylor expanded in z around inf 66.7%
if -4.9999999999999998e-82 < (*.f64 x y) < 1e-190 or 4.0000000000000001e-83 < (*.f64 x y) < 9.9999999999999998e-20Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in c around 0 79.9%
if 1e-190 < (*.f64 x y) < 4.0000000000000001e-83Initial program 100.0%
Taylor expanded in a around inf 76.0%
associate-*r*76.0%
*-commutative76.0%
Simplified76.0%
Final simplification79.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y)))
(t_2 (+ c (* 0.0625 (* z t))))
(t_3 (* b (* a -0.25))))
(if (<= (* a b) -5e+178)
t_3
(if (<= (* a b) -5e-93)
t_1
(if (<= (* a b) -4e-191)
t_2
(if (<= (* a b) 2e-23) t_1 (if (<= (* a b) 5e+81) t_2 (+ c t_3))))))))
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 + (0.0625 * (z * t));
double t_3 = b * (a * -0.25);
double tmp;
if ((a * b) <= -5e+178) {
tmp = t_3;
} else if ((a * b) <= -5e-93) {
tmp = t_1;
} else if ((a * b) <= -4e-191) {
tmp = t_2;
} else if ((a * b) <= 2e-23) {
tmp = t_1;
} else if ((a * b) <= 5e+81) {
tmp = t_2;
} else {
tmp = c + 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 = c + (x * y)
t_2 = c + (0.0625d0 * (z * t))
t_3 = b * (a * (-0.25d0))
if ((a * b) <= (-5d+178)) then
tmp = t_3
else if ((a * b) <= (-5d-93)) then
tmp = t_1
else if ((a * b) <= (-4d-191)) then
tmp = t_2
else if ((a * b) <= 2d-23) then
tmp = t_1
else if ((a * b) <= 5d+81) then
tmp = t_2
else
tmp = c + 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 = c + (x * y);
double t_2 = c + (0.0625 * (z * t));
double t_3 = b * (a * -0.25);
double tmp;
if ((a * b) <= -5e+178) {
tmp = t_3;
} else if ((a * b) <= -5e-93) {
tmp = t_1;
} else if ((a * b) <= -4e-191) {
tmp = t_2;
} else if ((a * b) <= 2e-23) {
tmp = t_1;
} else if ((a * b) <= 5e+81) {
tmp = t_2;
} else {
tmp = c + t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = c + (0.0625 * (z * t)) t_3 = b * (a * -0.25) tmp = 0 if (a * b) <= -5e+178: tmp = t_3 elif (a * b) <= -5e-93: tmp = t_1 elif (a * b) <= -4e-191: tmp = t_2 elif (a * b) <= 2e-23: tmp = t_1 elif (a * b) <= 5e+81: tmp = t_2 else: tmp = c + t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(c + Float64(0.0625 * Float64(z * t))) t_3 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (Float64(a * b) <= -5e+178) tmp = t_3; elseif (Float64(a * b) <= -5e-93) tmp = t_1; elseif (Float64(a * b) <= -4e-191) tmp = t_2; elseif (Float64(a * b) <= 2e-23) tmp = t_1; elseif (Float64(a * b) <= 5e+81) tmp = t_2; else tmp = Float64(c + t_3); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = c + (0.0625 * (z * t)); t_3 = b * (a * -0.25); tmp = 0.0; if ((a * b) <= -5e+178) tmp = t_3; elseif ((a * b) <= -5e-93) tmp = t_1; elseif ((a * b) <= -4e-191) tmp = t_2; elseif ((a * b) <= 2e-23) tmp = t_1; elseif ((a * b) <= 5e+81) tmp = t_2; else tmp = c + t_3; 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+178], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -5e-93], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -4e-191], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2e-23], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5e+81], t$95$2, N[(c + t$95$3), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+178}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-191}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+81}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;c + t\_3\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e178Initial program 100.0%
Taylor expanded in x around 0 91.6%
Taylor expanded in a around inf 85.9%
associate-*r*85.9%
*-commutative85.9%
*-commutative85.9%
Simplified85.9%
if -4.9999999999999999e178 < (*.f64 a b) < -4.99999999999999994e-93 or -4.0000000000000001e-191 < (*.f64 a b) < 1.99999999999999992e-23Initial program 100.0%
Taylor expanded in x around inf 68.4%
if -4.99999999999999994e-93 < (*.f64 a b) < -4.0000000000000001e-191 or 1.99999999999999992e-23 < (*.f64 a b) < 4.9999999999999998e81Initial program 100.0%
Taylor expanded in z around inf 76.0%
if 4.9999999999999998e81 < (*.f64 a b) Initial program 97.8%
Taylor expanded in a around inf 75.2%
associate-*r*75.2%
*-commutative75.2%
Simplified75.2%
Final simplification72.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* z t)))) (t_2 (- (* x y) (* (* a b) 0.25))))
(if (<= (* x y) -5e+30)
t_2
(if (<= (* x y) 4e-197)
t_1
(if (<= (* x y) 2e-41)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 1e-19) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (z * t));
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -5e+30) {
tmp = t_2;
} else if ((x * y) <= 4e-197) {
tmp = t_1;
} else if ((x * y) <= 2e-41) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1e-19) {
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 + (0.0625d0 * (z * t))
t_2 = (x * y) - ((a * b) * 0.25d0)
if ((x * y) <= (-5d+30)) then
tmp = t_2
else if ((x * y) <= 4d-197) then
tmp = t_1
else if ((x * y) <= 2d-41) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 1d-19) 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 + (0.0625 * (z * t));
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -5e+30) {
tmp = t_2;
} else if ((x * y) <= 4e-197) {
tmp = t_1;
} else if ((x * y) <= 2e-41) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1e-19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (z * t)) t_2 = (x * y) - ((a * b) * 0.25) tmp = 0 if (x * y) <= -5e+30: tmp = t_2 elif (x * y) <= 4e-197: tmp = t_1 elif (x * y) <= 2e-41: tmp = c + (b * (a * -0.25)) elif (x * y) <= 1e-19: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(z * t))) t_2 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -5e+30) tmp = t_2; elseif (Float64(x * y) <= 4e-197) tmp = t_1; elseif (Float64(x * y) <= 2e-41) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 1e-19) 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 + (0.0625 * (z * t)); t_2 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((x * y) <= -5e+30) tmp = t_2; elseif ((x * y) <= 4e-197) tmp = t_1; elseif ((x * y) <= 2e-41) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 1e-19) 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+30], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4e-197], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-41], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-19], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-41}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999998e30 or 9.9999999999999998e-20 < (*.f64 x y) Initial program 100.0%
Taylor expanded in z around 0 90.1%
Taylor expanded in y around inf 87.7%
Taylor expanded in x around inf 82.8%
if -4.9999999999999998e30 < (*.f64 x y) < 3.9999999999999999e-197 or 2.00000000000000001e-41 < (*.f64 x y) < 9.9999999999999998e-20Initial program 99.0%
Taylor expanded in z around inf 67.6%
if 3.9999999999999999e-197 < (*.f64 x y) < 2.00000000000000001e-41Initial program 100.0%
Taylor expanded in a around inf 75.1%
associate-*r*75.1%
*-commutative75.1%
Simplified75.1%
Final simplification75.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -2e+74)
t_1
(if (<= (* x y) -8e+30)
(* b (* a -0.25))
(if (or (<= (* x y) -2e+30) (not (<= (* x y) 1e-19)))
t_1
(+ c (* 0.0625 (* z t))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -2e+74) {
tmp = t_1;
} else if ((x * y) <= -8e+30) {
tmp = b * (a * -0.25);
} else if (((x * y) <= -2e+30) || !((x * y) <= 1e-19)) {
tmp = t_1;
} else {
tmp = c + (0.0625 * (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-2d+74)) then
tmp = t_1
else if ((x * y) <= (-8d+30)) then
tmp = b * (a * (-0.25d0))
else if (((x * y) <= (-2d+30)) .or. (.not. ((x * y) <= 1d-19))) then
tmp = t_1
else
tmp = c + (0.0625d0 * (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -2e+74) {
tmp = t_1;
} else if ((x * y) <= -8e+30) {
tmp = b * (a * -0.25);
} else if (((x * y) <= -2e+30) || !((x * y) <= 1e-19)) {
tmp = t_1;
} else {
tmp = c + (0.0625 * (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -2e+74: tmp = t_1 elif (x * y) <= -8e+30: tmp = b * (a * -0.25) elif ((x * y) <= -2e+30) or not ((x * y) <= 1e-19): tmp = t_1 else: tmp = c + (0.0625 * (z * t)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2e+74) tmp = t_1; elseif (Float64(x * y) <= -8e+30) tmp = Float64(b * Float64(a * -0.25)); elseif ((Float64(x * y) <= -2e+30) || !(Float64(x * y) <= 1e-19)) tmp = t_1; else tmp = Float64(c + Float64(0.0625 * Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -2e+74) tmp = t_1; elseif ((x * y) <= -8e+30) tmp = b * (a * -0.25); elseif (((x * y) <= -2e+30) || ~(((x * y) <= 1e-19))) tmp = t_1; else tmp = c + (0.0625 * (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+74], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -8e+30], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+30], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e-19]], $MachinePrecision]], t$95$1, N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -8 \cdot 10^{+30}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+30} \lor \neg \left(x \cdot y \leq 10^{-19}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e74 or -8.0000000000000002e30 < (*.f64 x y) < -2e30 or 9.9999999999999998e-20 < (*.f64 x y) Initial program 100.0%
Taylor expanded in x around inf 73.5%
if -1.9999999999999999e74 < (*.f64 x y) < -8.0000000000000002e30Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in a around inf 65.4%
associate-*r*65.4%
*-commutative65.4%
*-commutative65.4%
Simplified65.4%
if -2e30 < (*.f64 x y) < 9.9999999999999998e-20Initial program 99.2%
Taylor expanded in z around inf 63.9%
Final simplification68.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= (* x y) -1.65e+74)
(* x y)
(if (<= (* x y) -6.5e+30)
t_1
(if (<= (* x y) -3.9e-79) c (if (<= (* x y) 2.8e+39) t_1 (* 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 * y) <= -1.65e+74) {
tmp = x * y;
} else if ((x * y) <= -6.5e+30) {
tmp = t_1;
} else if ((x * y) <= -3.9e-79) {
tmp = c;
} else if ((x * y) <= 2.8e+39) {
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 = b * (a * (-0.25d0))
if ((x * y) <= (-1.65d+74)) then
tmp = x * y
else if ((x * y) <= (-6.5d+30)) then
tmp = t_1
else if ((x * y) <= (-3.9d-79)) then
tmp = c
else if ((x * y) <= 2.8d+39) 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 = b * (a * -0.25);
double tmp;
if ((x * y) <= -1.65e+74) {
tmp = x * y;
} else if ((x * y) <= -6.5e+30) {
tmp = t_1;
} else if ((x * y) <= -3.9e-79) {
tmp = c;
} else if ((x * y) <= 2.8e+39) {
tmp = t_1;
} 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 * y) <= -1.65e+74: tmp = x * y elif (x * y) <= -6.5e+30: tmp = t_1 elif (x * y) <= -3.9e-79: tmp = c elif (x * y) <= 2.8e+39: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (Float64(x * y) <= -1.65e+74) tmp = Float64(x * y); elseif (Float64(x * y) <= -6.5e+30) tmp = t_1; elseif (Float64(x * y) <= -3.9e-79) tmp = c; elseif (Float64(x * y) <= 2.8e+39) 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 = b * (a * -0.25); tmp = 0.0; if ((x * y) <= -1.65e+74) tmp = x * y; elseif ((x * y) <= -6.5e+30) tmp = t_1; elseif ((x * y) <= -3.9e-79) tmp = c; elseif ((x * y) <= 2.8e+39) 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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.65e+74], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -6.5e+30], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.9e-79], c, If[LessEqual[N[(x * y), $MachinePrecision], 2.8e+39], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -1.65 \cdot 10^{+74}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -6.5 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -3.9 \cdot 10^{-79}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.6500000000000001e74 or 2.80000000000000001e39 < (*.f64 x y) Initial program 100.0%
Taylor expanded in x around inf 76.7%
Taylor expanded in x around inf 69.9%
if -1.6500000000000001e74 < (*.f64 x y) < -6.5e30 or -3.90000000000000006e-79 < (*.f64 x y) < 2.80000000000000001e39Initial program 99.2%
Taylor expanded in x around 0 95.7%
Taylor expanded in a around inf 41.0%
associate-*r*41.0%
*-commutative41.0%
*-commutative41.0%
Simplified41.0%
if -6.5e30 < (*.f64 x y) < -3.90000000000000006e-79Initial program 100.0%
Taylor expanded in c around inf 36.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (or (<= (* x y) -2e+74) (not (<= (* x y) 1e-19)))
(- (+ c (* x y)) t_1)
(- (+ c (* 0.0625 (* z t))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double tmp;
if (((x * y) <= -2e+74) || !((x * y) <= 1e-19)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + (0.0625 * (z * t))) - 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 = (a * b) * 0.25d0
if (((x * y) <= (-2d+74)) .or. (.not. ((x * y) <= 1d-19))) then
tmp = (c + (x * y)) - t_1
else
tmp = (c + (0.0625d0 * (z * t))) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double tmp;
if (((x * y) <= -2e+74) || !((x * y) <= 1e-19)) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = (c + (0.0625 * (z * t))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if ((x * y) <= -2e+74) or not ((x * y) <= 1e-19): tmp = (c + (x * y)) - t_1 else: tmp = (c + (0.0625 * (z * t))) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if ((Float64(x * y) <= -2e+74) || !(Float64(x * y) <= 1e-19)) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; tmp = 0.0; if (((x * y) <= -2e+74) || ~(((x * y) <= 1e-19))) tmp = (c + (x * y)) - t_1; else tmp = (c + (0.0625 * (z * t))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+74], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e-19]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+74} \lor \neg \left(x \cdot y \leq 10^{-19}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e74 or 9.9999999999999998e-20 < (*.f64 x y) Initial program 100.0%
Taylor expanded in z around 0 90.7%
if -1.9999999999999999e74 < (*.f64 x y) < 9.9999999999999998e-20Initial program 99.3%
Taylor expanded in x around 0 95.4%
Final simplification93.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.9e+207)
(* z (+ (* -0.25 (/ (* a b) z)) (* t 0.0625)))
(if (<= z 4.8e+20)
(- (+ c (* x y)) (* (* a b) 0.25))
(+ c (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.9e+207) {
tmp = z * ((-0.25 * ((a * b) / z)) + (t * 0.0625));
} else if (z <= 4.8e+20) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + (0.0625 * (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-1.9d+207)) then
tmp = z * (((-0.25d0) * ((a * b) / z)) + (t * 0.0625d0))
else if (z <= 4.8d+20) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + (0.0625d0 * (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.9e+207) {
tmp = z * ((-0.25 * ((a * b) / z)) + (t * 0.0625));
} else if (z <= 4.8e+20) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + (0.0625 * (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.9e+207: tmp = z * ((-0.25 * ((a * b) / z)) + (t * 0.0625)) elif z <= 4.8e+20: tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + (0.0625 * (z * t)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.9e+207) tmp = Float64(z * Float64(Float64(-0.25 * Float64(Float64(a * b) / z)) + Float64(t * 0.0625))); elseif (z <= 4.8e+20) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(0.0625 * Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (z <= -1.9e+207) tmp = z * ((-0.25 * ((a * b) / z)) + (t * 0.0625)); elseif (z <= 4.8e+20) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + (0.0625 * (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.9e+207], N[(z * N[(N[(-0.25 * N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+20], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+207}:\\
\;\;\;\;z \cdot \left(-0.25 \cdot \frac{a \cdot b}{z} + t \cdot 0.0625\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+20}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if z < -1.89999999999999993e207Initial program 93.3%
Taylor expanded in x around 0 81.0%
Taylor expanded in c around 0 74.4%
Taylor expanded in z around inf 81.0%
if -1.89999999999999993e207 < z < 4.8e20Initial program 99.9%
Taylor expanded in z around 0 84.8%
if 4.8e20 < z Initial program 100.0%
Taylor expanded in z around inf 57.0%
Final simplification77.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= z -1.7e+207)
(- t_2 t_1)
(if (<= z 8.2e+14) (- (+ c (* x y)) t_1) (+ c t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if (z <= -1.7e+207) {
tmp = t_2 - t_1;
} else if (z <= 8.2e+14) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = c + 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 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if (z <= (-1.7d+207)) then
tmp = t_2 - t_1
else if (z <= 8.2d+14) then
tmp = (c + (x * y)) - t_1
else
tmp = c + 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 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if (z <= -1.7e+207) {
tmp = t_2 - t_1;
} else if (z <= 8.2e+14) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = c + t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if z <= -1.7e+207: tmp = t_2 - t_1 elif z <= 8.2e+14: tmp = (c + (x * y)) - t_1 else: tmp = c + t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (z <= -1.7e+207) tmp = Float64(t_2 - t_1); elseif (z <= 8.2e+14) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = Float64(c + t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if (z <= -1.7e+207) tmp = t_2 - t_1; elseif (z <= 8.2e+14) tmp = (c + (x * y)) - t_1; else tmp = c + t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+207], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[z, 8.2e+14], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+207}:\\
\;\;\;\;t\_2 - t\_1\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+14}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;c + t\_2\\
\end{array}
\end{array}
if z < -1.6999999999999999e207Initial program 93.3%
Taylor expanded in x around 0 81.0%
Taylor expanded in c around 0 74.4%
if -1.6999999999999999e207 < z < 8.2e14Initial program 99.9%
Taylor expanded in z around 0 84.8%
if 8.2e14 < z Initial program 100.0%
Taylor expanded in z around inf 57.0%
Final simplification77.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -5.8e+71) (not (<= (* x y) 4.8e-22))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -5.8e+71) || !((x * y) <= 4.8e-22)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-5.8d+71)) .or. (.not. ((x * y) <= 4.8d-22))) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -5.8e+71) || !((x * y) <= 4.8e-22)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -5.8e+71) or not ((x * y) <= 4.8e-22): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -5.8e+71) || !(Float64(x * y) <= 4.8e-22)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -5.8e+71) || ~(((x * y) <= 4.8e-22))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5.8e+71], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.8e-22]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+71} \lor \neg \left(x \cdot y \leq 4.8 \cdot 10^{-22}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -5.80000000000000014e71 or 4.80000000000000005e-22 < (*.f64 x y) Initial program 100.0%
Taylor expanded in x around inf 71.0%
Taylor expanded in x around inf 65.0%
if -5.80000000000000014e71 < (*.f64 x y) < 4.80000000000000005e-22Initial program 99.3%
Taylor expanded in c around inf 26.7%
Final simplification43.1%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 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 + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -1.7e-35) (not (<= b 8.6e+160))) (* 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 <= -1.7e-35) || !(b <= 8.6e+160)) {
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 <= (-1.7d-35)) .or. (.not. (b <= 8.6d+160))) 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 <= -1.7e-35) || !(b <= 8.6e+160)) {
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 <= -1.7e-35) or not (b <= 8.6e+160): 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 ((b <= -1.7e-35) || !(b <= 8.6e+160)) tmp = Float64(b * Float64(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 <= -1.7e-35) || ~((b <= 8.6e+160))) 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[b, -1.7e-35], N[Not[LessEqual[b, 8.6e+160]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{-35} \lor \neg \left(b \leq 8.6 \cdot 10^{+160}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if b < -1.7000000000000001e-35 or 8.59999999999999978e160 < b Initial program 99.0%
Taylor expanded in x around 0 74.7%
Taylor expanded in a around inf 47.8%
associate-*r*47.8%
*-commutative47.8%
*-commutative47.8%
Simplified47.8%
if -1.7000000000000001e-35 < b < 8.59999999999999978e160Initial program 100.0%
Taylor expanded in x around inf 55.4%
Final simplification52.3%
(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 99.6%
Taylor expanded in c around inf 18.5%
herbie shell --seed 2024108
(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))