
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (+ (fma 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 94.5%
associate--l+94.5%
fma-define97.3%
associate-/l*97.6%
fma-neg98.4%
distribute-neg-frac298.4%
metadata-eval98.4%
Simplified98.4%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* a b) 5e+274) (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))) (+ c (* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= 5e+274) {
tmp = c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= 5e+274) tmp = Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], 5e+274], N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq 5 \cdot 10^{+274}:\\
\;\;\;\;c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < 4.9999999999999998e274Initial program 97.5%
associate-+l-97.5%
*-commutative97.5%
associate-+l-97.5%
fma-define99.2%
*-commutative99.2%
associate-/l*99.6%
associate-/l*99.6%
Simplified99.6%
if 4.9999999999999998e274 < (*.f64 a b) Initial program 52.9%
Taylor expanded in a around inf 76.5%
*-commutative76.5%
associate-*r*76.5%
Simplified76.5%
Final simplification98.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) (* z (+ (* t 0.0625) (/ c z))))))
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 = z * ((t * 0.0625) + (c / z));
}
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 = z * ((t * 0.0625) + (c / z));
}
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 = z * ((t * 0.0625) + (c / z)) 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(z * Float64(Float64(t * 0.0625) + Float64(c / z))); 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 = z * ((t * 0.0625) + (c / z)); 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[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(c / z), $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}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in z around inf 44.3%
associate-*r*44.3%
*-commutative44.3%
associate-*r*44.3%
Simplified44.3%
Taylor expanded in z around inf 57.3%
Final simplification97.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))))
(if (<= (* a b) -2e-25)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) -2e-143)
t_1
(if (<= (* a b) 1e-301)
(+ c (* x y))
(if (<= (* a b) 1e+80) t_1 (+ c (* a (* b -0.25)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double tmp;
if ((a * b) <= -2e-25) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= -2e-143) {
tmp = t_1;
} else if ((a * b) <= 1e-301) {
tmp = c + (x * y);
} else if ((a * b) <= 1e+80) {
tmp = t_1;
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
if ((a * b) <= (-2d-25)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= (-2d-143)) then
tmp = t_1
else if ((a * b) <= 1d-301) then
tmp = c + (x * y)
else if ((a * b) <= 1d+80) then
tmp = t_1
else
tmp = c + (a * (b * (-0.25d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double tmp;
if ((a * b) <= -2e-25) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= -2e-143) {
tmp = t_1;
} else if ((a * b) <= 1e-301) {
tmp = c + (x * y);
} else if ((a * b) <= 1e+80) {
tmp = t_1;
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) tmp = 0 if (a * b) <= -2e-25: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= -2e-143: tmp = t_1 elif (a * b) <= 1e-301: tmp = c + (x * y) elif (a * b) <= 1e+80: tmp = t_1 else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) tmp = 0.0 if (Float64(a * b) <= -2e-25) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= -2e-143) tmp = t_1; elseif (Float64(a * b) <= 1e-301) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 1e+80) tmp = t_1; else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (t * (z * 0.0625)); tmp = 0.0; if ((a * b) <= -2e-25) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= -2e-143) tmp = t_1; elseif ((a * b) <= 1e-301) tmp = c + (x * y); elseif ((a * b) <= 1e+80) tmp = t_1; else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e-25], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2e-143], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-301], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+80], t$95$1, N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-301}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000008e-25Initial program 96.0%
Taylor expanded in z around 0 88.4%
Taylor expanded in c around 0 79.2%
if -2.00000000000000008e-25 < (*.f64 a b) < -1.9999999999999999e-143 or 1.00000000000000007e-301 < (*.f64 a b) < 1e80Initial program 97.8%
Taylor expanded in z around inf 75.2%
associate-*r*75.2%
*-commutative75.2%
associate-*r*75.2%
Simplified75.2%
if -1.9999999999999999e-143 < (*.f64 a b) < 1.00000000000000007e-301Initial program 97.8%
Taylor expanded in x around inf 76.0%
if 1e80 < (*.f64 a b) Initial program 81.8%
Taylor expanded in a around inf 71.2%
*-commutative71.2%
associate-*r*71.2%
Simplified71.2%
Final simplification75.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= a -1.55e-5)
t_1
(if (<= a -5.5e-53)
(* x y)
(if (<= a -1.9e-242)
c
(if (<= a -4e-298) (* x y) (if (<= a 1.05e-22) 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 <= -1.55e-5) {
tmp = t_1;
} else if (a <= -5.5e-53) {
tmp = x * y;
} else if (a <= -1.9e-242) {
tmp = c;
} else if (a <= -4e-298) {
tmp = x * y;
} else if (a <= 1.05e-22) {
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 <= (-1.55d-5)) then
tmp = t_1
else if (a <= (-5.5d-53)) then
tmp = x * y
else if (a <= (-1.9d-242)) then
tmp = c
else if (a <= (-4d-298)) then
tmp = x * y
else if (a <= 1.05d-22) 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 <= -1.55e-5) {
tmp = t_1;
} else if (a <= -5.5e-53) {
tmp = x * y;
} else if (a <= -1.9e-242) {
tmp = c;
} else if (a <= -4e-298) {
tmp = x * y;
} else if (a <= 1.05e-22) {
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 <= -1.55e-5: tmp = t_1 elif a <= -5.5e-53: tmp = x * y elif a <= -1.9e-242: tmp = c elif a <= -4e-298: tmp = x * y elif a <= 1.05e-22: 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 <= -1.55e-5) tmp = t_1; elseif (a <= -5.5e-53) tmp = Float64(x * y); elseif (a <= -1.9e-242) tmp = c; elseif (a <= -4e-298) tmp = Float64(x * y); elseif (a <= 1.05e-22) 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 <= -1.55e-5) tmp = t_1; elseif (a <= -5.5e-53) tmp = x * y; elseif (a <= -1.9e-242) tmp = c; elseif (a <= -4e-298) tmp = x * y; elseif (a <= 1.05e-22) 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, -1.55e-5], t$95$1, If[LessEqual[a, -5.5e-53], N[(x * y), $MachinePrecision], If[LessEqual[a, -1.9e-242], c, If[LessEqual[a, -4e-298], N[(x * y), $MachinePrecision], If[LessEqual[a, 1.05e-22], c, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;a \leq -1.55 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -5.5 \cdot 10^{-53}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-242}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \leq -4 \cdot 10^{-298}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-22}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.55000000000000007e-5 or 1.05000000000000004e-22 < a Initial program 91.0%
Taylor expanded in z around 0 81.1%
Taylor expanded in c around 0 65.6%
Taylor expanded in x around 0 54.1%
*-commutative54.1%
*-commutative54.1%
associate-*l*54.1%
*-commutative54.1%
Simplified54.1%
if -1.55000000000000007e-5 < a < -5.50000000000000023e-53 or -1.9000000000000001e-242 < a < -3.99999999999999965e-298Initial program 100.0%
Taylor expanded in z around 0 62.1%
Taylor expanded in c around 0 50.8%
Taylor expanded in x around inf 42.2%
if -5.50000000000000023e-53 < a < -1.9000000000000001e-242 or -3.99999999999999965e-298 < a < 1.05000000000000004e-22Initial program 97.7%
Taylor expanded in c around inf 36.8%
Final simplification46.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))))
(if (<= t -3.4e-103)
(+ (* x y) (* 0.0625 (* z t)))
(if (<= t -2.7e-280)
t_1
(if (<= t 9.6e-105)
(+ c (* x y))
(if (<= t 2.7e+195) t_1 (+ c (* t (* z 0.0625)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double tmp;
if (t <= -3.4e-103) {
tmp = (x * y) + (0.0625 * (z * t));
} else if (t <= -2.7e-280) {
tmp = t_1;
} else if (t <= 9.6e-105) {
tmp = c + (x * y);
} else if (t <= 2.7e+195) {
tmp = t_1;
} else {
tmp = c + (t * (z * 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) :: t_1
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
if (t <= (-3.4d-103)) then
tmp = (x * y) + (0.0625d0 * (z * t))
else if (t <= (-2.7d-280)) then
tmp = t_1
else if (t <= 9.6d-105) then
tmp = c + (x * y)
else if (t <= 2.7d+195) then
tmp = t_1
else
tmp = c + (t * (z * 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 t_1 = c + (a * (b * -0.25));
double tmp;
if (t <= -3.4e-103) {
tmp = (x * y) + (0.0625 * (z * t));
} else if (t <= -2.7e-280) {
tmp = t_1;
} else if (t <= 9.6e-105) {
tmp = c + (x * y);
} else if (t <= 2.7e+195) {
tmp = t_1;
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) tmp = 0 if t <= -3.4e-103: tmp = (x * y) + (0.0625 * (z * t)) elif t <= -2.7e-280: tmp = t_1 elif t <= 9.6e-105: tmp = c + (x * y) elif t <= 2.7e+195: tmp = t_1 else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (t <= -3.4e-103) tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); elseif (t <= -2.7e-280) tmp = t_1; elseif (t <= 9.6e-105) tmp = Float64(c + Float64(x * y)); elseif (t <= 2.7e+195) tmp = t_1; else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); tmp = 0.0; if (t <= -3.4e-103) tmp = (x * y) + (0.0625 * (z * t)); elseif (t <= -2.7e-280) tmp = t_1; elseif (t <= 9.6e-105) tmp = c + (x * y); elseif (t <= 2.7e+195) tmp = t_1; else tmp = c + (t * (z * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-103], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.7e-280], t$95$1, If[LessEqual[t, 9.6e-105], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e+195], t$95$1, N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-103}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-280}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-105}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+195}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if t < -3.40000000000000003e-103Initial program 91.5%
Taylor expanded in x around inf 88.2%
*-commutative88.2%
associate-/l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around 0 74.0%
Taylor expanded in c around 0 61.2%
Taylor expanded in x around 0 61.1%
if -3.40000000000000003e-103 < t < -2.69999999999999984e-280 or 9.6000000000000006e-105 < t < 2.7000000000000002e195Initial program 95.4%
Taylor expanded in a around inf 67.7%
*-commutative67.7%
associate-*r*67.7%
Simplified67.7%
if -2.69999999999999984e-280 < t < 9.6000000000000006e-105Initial program 97.5%
Taylor expanded in x around inf 71.1%
if 2.7000000000000002e195 < t Initial program 95.7%
Taylor expanded in z around inf 83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*r*83.0%
Simplified83.0%
Final simplification67.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))))
(if (<= t -4e-53)
(* z (* t 0.0625))
(if (<= t -1.35e-277)
t_1
(if (<= t 9e-105)
(+ c (* x y))
(if (<= t 2.8e+195) t_1 (+ c (* t (* z 0.0625)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double tmp;
if (t <= -4e-53) {
tmp = z * (t * 0.0625);
} else if (t <= -1.35e-277) {
tmp = t_1;
} else if (t <= 9e-105) {
tmp = c + (x * y);
} else if (t <= 2.8e+195) {
tmp = t_1;
} else {
tmp = c + (t * (z * 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) :: t_1
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
if (t <= (-4d-53)) then
tmp = z * (t * 0.0625d0)
else if (t <= (-1.35d-277)) then
tmp = t_1
else if (t <= 9d-105) then
tmp = c + (x * y)
else if (t <= 2.8d+195) then
tmp = t_1
else
tmp = c + (t * (z * 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 t_1 = c + (a * (b * -0.25));
double tmp;
if (t <= -4e-53) {
tmp = z * (t * 0.0625);
} else if (t <= -1.35e-277) {
tmp = t_1;
} else if (t <= 9e-105) {
tmp = c + (x * y);
} else if (t <= 2.8e+195) {
tmp = t_1;
} else {
tmp = c + (t * (z * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) tmp = 0 if t <= -4e-53: tmp = z * (t * 0.0625) elif t <= -1.35e-277: tmp = t_1 elif t <= 9e-105: tmp = c + (x * y) elif t <= 2.8e+195: tmp = t_1 else: tmp = c + (t * (z * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (t <= -4e-53) tmp = Float64(z * Float64(t * 0.0625)); elseif (t <= -1.35e-277) tmp = t_1; elseif (t <= 9e-105) tmp = Float64(c + Float64(x * y)); elseif (t <= 2.8e+195) tmp = t_1; else tmp = Float64(c + Float64(t * Float64(z * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); tmp = 0.0; if (t <= -4e-53) tmp = z * (t * 0.0625); elseif (t <= -1.35e-277) tmp = t_1; elseif (t <= 9e-105) tmp = c + (x * y); elseif (t <= 2.8e+195) tmp = t_1; else tmp = c + (t * (z * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e-53], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e-277], t$95$1, If[LessEqual[t, 9e-105], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e+195], t$95$1, N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{-53}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-277}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-105}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+195}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\end{array}
\end{array}
if t < -4.00000000000000012e-53Initial program 90.0%
Taylor expanded in z around inf 50.0%
associate-*r*50.0%
*-commutative50.0%
associate-*r*50.0%
Simplified50.0%
Taylor expanded in z around inf 46.1%
Taylor expanded in t around inf 37.5%
if -4.00000000000000012e-53 < t < -1.34999999999999988e-277 or 8.9999999999999995e-105 < t < 2.7999999999999998e195Initial program 95.9%
Taylor expanded in a around inf 67.3%
*-commutative67.3%
associate-*r*67.3%
Simplified67.3%
if -1.34999999999999988e-277 < t < 8.9999999999999995e-105Initial program 97.5%
Taylor expanded in x around inf 71.1%
if 2.7999999999999998e195 < t Initial program 95.7%
Taylor expanded in z around inf 83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*r*83.0%
Simplified83.0%
Final simplification61.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (* z (* t 0.0625))))
(if (<= t -4e-53)
t_2
(if (<= t -4.1e-280)
t_1
(if (<= t 9.6e-105) (+ c (* x y)) (if (<= t 2.9e+196) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = z * (t * 0.0625);
double tmp;
if (t <= -4e-53) {
tmp = t_2;
} else if (t <= -4.1e-280) {
tmp = t_1;
} else if (t <= 9.6e-105) {
tmp = c + (x * y);
} else if (t <= 2.9e+196) {
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 + (a * (b * (-0.25d0)))
t_2 = z * (t * 0.0625d0)
if (t <= (-4d-53)) then
tmp = t_2
else if (t <= (-4.1d-280)) then
tmp = t_1
else if (t <= 9.6d-105) then
tmp = c + (x * y)
else if (t <= 2.9d+196) 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 + (a * (b * -0.25));
double t_2 = z * (t * 0.0625);
double tmp;
if (t <= -4e-53) {
tmp = t_2;
} else if (t <= -4.1e-280) {
tmp = t_1;
} else if (t <= 9.6e-105) {
tmp = c + (x * y);
} else if (t <= 2.9e+196) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = z * (t * 0.0625) tmp = 0 if t <= -4e-53: tmp = t_2 elif t <= -4.1e-280: tmp = t_1 elif t <= 9.6e-105: tmp = c + (x * y) elif t <= 2.9e+196: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (t <= -4e-53) tmp = t_2; elseif (t <= -4.1e-280) tmp = t_1; elseif (t <= 9.6e-105) tmp = Float64(c + Float64(x * y)); elseif (t <= 2.9e+196) 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 + (a * (b * -0.25)); t_2 = z * (t * 0.0625); tmp = 0.0; if (t <= -4e-53) tmp = t_2; elseif (t <= -4.1e-280) tmp = t_1; elseif (t <= 9.6e-105) tmp = c + (x * y); elseif (t <= 2.9e+196) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e-53], t$95$2, If[LessEqual[t, -4.1e-280], t$95$1, If[LessEqual[t, 9.6e-105], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+196], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{-53}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{-280}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-105}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+196}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -4.00000000000000012e-53 or 2.9e196 < t Initial program 91.4%
Taylor expanded in z around inf 58.1%
associate-*r*58.1%
*-commutative58.1%
associate-*r*58.1%
Simplified58.1%
Taylor expanded in z around inf 53.2%
Taylor expanded in t around inf 45.7%
if -4.00000000000000012e-53 < t < -4.1000000000000002e-280 or 9.6000000000000006e-105 < t < 2.9e196Initial program 95.9%
Taylor expanded in a around inf 67.3%
*-commutative67.3%
associate-*r*67.3%
Simplified67.3%
if -4.1000000000000002e-280 < t < 9.6000000000000006e-105Initial program 97.5%
Taylor expanded in x around inf 71.1%
Final simplification60.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* a b) -4e-22)
(- t_1 (* (* a b) 0.25))
(if (<= (* a b) 1e+80)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ t_1 (/ -1.0 (/ 4.0 (* a b))))))))
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 ((a * b) <= -4e-22) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 1e+80) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = t_1 + (-1.0 / (4.0 / (a * b)));
}
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 ((a * b) <= (-4d-22)) then
tmp = t_1 - ((a * b) * 0.25d0)
else if ((a * b) <= 1d+80) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = t_1 + ((-1.0d0) / (4.0d0 / (a * b)))
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 ((a * b) <= -4e-22) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 1e+80) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = t_1 + (-1.0 / (4.0 / (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (a * b) <= -4e-22: tmp = t_1 - ((a * b) * 0.25) elif (a * b) <= 1e+80: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = t_1 + (-1.0 / (4.0 / (a * b))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -4e-22) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 1e+80) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(t_1 + Float64(-1.0 / Float64(4.0 / Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((a * b) <= -4e-22) tmp = t_1 - ((a * b) * 0.25); elseif ((a * b) <= 1e+80) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = t_1 + (-1.0 / (4.0 / (a * b))); 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[(a * b), $MachinePrecision], -4e-22], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+80], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-1.0 / N[(4.0 / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{-22}:\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 10^{+80}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{-1}{\frac{4}{a \cdot b}}\\
\end{array}
\end{array}
if (*.f64 a b) < -4.0000000000000002e-22Initial program 96.0%
Taylor expanded in z around 0 88.2%
if -4.0000000000000002e-22 < (*.f64 a b) < 1e80Initial program 97.8%
Taylor expanded in a around 0 94.1%
if 1e80 < (*.f64 a b) Initial program 81.8%
Taylor expanded in z around 0 79.8%
*-commutative79.8%
metadata-eval79.8%
div-inv79.8%
clear-num79.8%
Applied egg-rr79.8%
Final simplification90.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 (<= t -3.7e-53)
t_2
(if (<= t -3.8e-277)
t_1
(if (<= t 1e-104) (* x y) (if (<= t 2.7e+195) t_1 t_2))))))
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 (t <= -3.7e-53) {
tmp = t_2;
} else if (t <= -3.8e-277) {
tmp = t_1;
} else if (t <= 1e-104) {
tmp = x * y;
} else if (t <= 2.7e+195) {
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 = b * (a * (-0.25d0))
t_2 = z * (t * 0.0625d0)
if (t <= (-3.7d-53)) then
tmp = t_2
else if (t <= (-3.8d-277)) then
tmp = t_1
else if (t <= 1d-104) then
tmp = x * y
else if (t <= 2.7d+195) 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 = b * (a * -0.25);
double t_2 = z * (t * 0.0625);
double tmp;
if (t <= -3.7e-53) {
tmp = t_2;
} else if (t <= -3.8e-277) {
tmp = t_1;
} else if (t <= 1e-104) {
tmp = x * y;
} else if (t <= 2.7e+195) {
tmp = t_1;
} else {
tmp = t_2;
}
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 t <= -3.7e-53: tmp = t_2 elif t <= -3.8e-277: tmp = t_1 elif t <= 1e-104: tmp = x * y elif t <= 2.7e+195: tmp = t_1 else: tmp = t_2 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 (t <= -3.7e-53) tmp = t_2; elseif (t <= -3.8e-277) tmp = t_1; elseif (t <= 1e-104) tmp = Float64(x * y); elseif (t <= 2.7e+195) tmp = t_1; else tmp = t_2; 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 (t <= -3.7e-53) tmp = t_2; elseif (t <= -3.8e-277) tmp = t_1; elseif (t <= 1e-104) tmp = x * y; elseif (t <= 2.7e+195) 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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.7e-53], t$95$2, If[LessEqual[t, -3.8e-277], t$95$1, If[LessEqual[t, 1e-104], N[(x * y), $MachinePrecision], If[LessEqual[t, 2.7e+195], t$95$1, t$95$2]]]]]]
\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}\;t \leq -3.7 \cdot 10^{-53}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-277}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10^{-104}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+195}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -3.69999999999999982e-53 or 2.7000000000000002e195 < t Initial program 91.4%
Taylor expanded in z around inf 58.1%
associate-*r*58.1%
*-commutative58.1%
associate-*r*58.1%
Simplified58.1%
Taylor expanded in z around inf 53.2%
Taylor expanded in t around inf 45.7%
if -3.69999999999999982e-53 < t < -3.79999999999999986e-277 or 9.99999999999999927e-105 < t < 2.7000000000000002e195Initial program 95.9%
Taylor expanded in z around 0 80.5%
Taylor expanded in c around 0 56.9%
Taylor expanded in x around 0 43.8%
*-commutative43.8%
*-commutative43.8%
associate-*l*43.8%
*-commutative43.8%
Simplified43.8%
if -3.79999999999999986e-277 < t < 9.99999999999999927e-105Initial program 97.5%
Taylor expanded in z around 0 97.5%
Taylor expanded in c around 0 61.2%
Taylor expanded in x around inf 34.6%
Final simplification43.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -4e-22) (not (<= (* a b) 1e+80))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -4e-22) || !((a * b) <= 1e+80)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-4d-22)) .or. (.not. ((a * b) <= 1d+80))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -4e-22) || !((a * b) <= 1e+80)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -4e-22) or not ((a * b) <= 1e+80): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -4e-22) || !(Float64(a * b) <= 1e+80)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -4e-22) || ~(((a * b) <= 1e+80))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -4e-22], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+80]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{-22} \lor \neg \left(a \cdot b \leq 10^{+80}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.0000000000000002e-22 or 1e80 < (*.f64 a b) Initial program 90.7%
Taylor expanded in z around 0 85.1%
if -4.0000000000000002e-22 < (*.f64 a b) < 1e80Initial program 97.8%
Taylor expanded in a around 0 94.1%
Final simplification89.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -1e+185)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 2e+143)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+185) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+143) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-1d+185)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 2d+143) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + (a * (b * (-0.25d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -1e+185) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+143) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -1e+185: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 2e+143: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -1e+185) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 2e+143) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -1e+185) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 2e+143) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+185], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+143], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+185}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+143}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.9999999999999998e184Initial program 95.7%
Taylor expanded in z around 0 93.6%
Taylor expanded in c around 0 93.3%
if -9.9999999999999998e184 < (*.f64 a b) < 2e143Initial program 97.7%
Taylor expanded in a around 0 88.9%
if 2e143 < (*.f64 a b) Initial program 77.1%
Taylor expanded in a around inf 77.6%
*-commutative77.6%
associate-*r*77.6%
Simplified77.6%
Final simplification88.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.12e-55) (not (<= (* x y) 2.5e+153))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.12e-55) || !((x * y) <= 2.5e+153)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-1.12d-55)) .or. (.not. ((x * y) <= 2.5d+153))) then
tmp = x * y
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.12e-55) || !((x * y) <= 2.5e+153)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.12e-55) or not ((x * y) <= 2.5e+153): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.12e-55) || !(Float64(x * y) <= 2.5e+153)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.12e-55) || ~(((x * y) <= 2.5e+153))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.12e-55], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.5e+153]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.12 \cdot 10^{-55} \lor \neg \left(x \cdot y \leq 2.5 \cdot 10^{+153}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.11999999999999997e-55 or 2.50000000000000009e153 < (*.f64 x y) Initial program 90.4%
Taylor expanded in z around 0 75.2%
Taylor expanded in c around 0 66.5%
Taylor expanded in x around inf 47.4%
if -1.11999999999999997e-55 < (*.f64 x y) < 2.50000000000000009e153Initial program 97.9%
Taylor expanded in c around inf 34.3%
Final simplification40.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -4.1e+98) (not (<= a 8.4e-22))) (* 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 ((a <= -4.1e+98) || !(a <= 8.4e-22)) {
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 ((a <= (-4.1d+98)) .or. (.not. (a <= 8.4d-22))) 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 ((a <= -4.1e+98) || !(a <= 8.4e-22)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -4.1e+98) or not (a <= 8.4e-22): 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 ((a <= -4.1e+98) || !(a <= 8.4e-22)) 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 ((a <= -4.1e+98) || ~((a <= 8.4e-22))) 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[a, -4.1e+98], N[Not[LessEqual[a, 8.4e-22]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+98} \lor \neg \left(a \leq 8.4 \cdot 10^{-22}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -4.1e98 or 8.40000000000000031e-22 < a Initial program 89.9%
Taylor expanded in z around 0 80.5%
Taylor expanded in c around 0 64.9%
Taylor expanded in x around 0 54.5%
*-commutative54.5%
*-commutative54.5%
associate-*l*54.5%
*-commutative54.5%
Simplified54.5%
if -4.1e98 < a < 8.40000000000000031e-22Initial program 98.5%
Taylor expanded in x around inf 58.7%
Final simplification56.7%
(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 94.5%
Taylor expanded in c around inf 23.9%
herbie shell --seed 2024116
(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))