
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
(if (<= t_1 INFINITY)
(+ c t_1)
(+ c (* y (+ x (* 0.0625 (/ (* z t) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (y * (x + (0.0625 * ((z * t) / y)))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + (y * (x + (0.0625 * ((z * t) / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\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 y around inf 0.0%
Taylor expanded in a around 0 83.3%
Final simplification99.6%
(FPCore (x y z t a b c) :precision binary64 (+ (- (fma 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 (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right) + c
\end{array}
Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
associate-+l-97.6%
fma-define97.6%
*-commutative97.6%
associate-/l*97.6%
associate-/l*98.0%
Simplified98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625))))
(t_2 (+ c (* a (* b -0.25))))
(t_3 (+ c (* x y))))
(if (<= (* x y) -1e+162)
t_3
(if (<= (* x y) -2000000000000.0)
t_1
(if (<= (* x y) -2e-291)
t_2
(if (<= (* x y) 2e-303)
t_1
(if (<= (* x y) 2e-21) t_2 (if (<= (* x y) 4e+39) t_1 t_3))))))))
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 t_2 = c + (a * (b * -0.25));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1e+162) {
tmp = t_3;
} else if ((x * y) <= -2000000000000.0) {
tmp = t_1;
} else if ((x * y) <= -2e-291) {
tmp = t_2;
} else if ((x * y) <= 2e-303) {
tmp = t_1;
} else if ((x * y) <= 2e-21) {
tmp = t_2;
} else if ((x * y) <= 4e+39) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
t_2 = c + (a * (b * (-0.25d0)))
t_3 = c + (x * y)
if ((x * y) <= (-1d+162)) then
tmp = t_3
else if ((x * y) <= (-2000000000000.0d0)) then
tmp = t_1
else if ((x * y) <= (-2d-291)) then
tmp = t_2
else if ((x * y) <= 2d-303) then
tmp = t_1
else if ((x * y) <= 2d-21) then
tmp = t_2
else if ((x * y) <= 4d+39) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + (a * (b * -0.25));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1e+162) {
tmp = t_3;
} else if ((x * y) <= -2000000000000.0) {
tmp = t_1;
} else if ((x * y) <= -2e-291) {
tmp = t_2;
} else if ((x * y) <= 2e-303) {
tmp = t_1;
} else if ((x * y) <= 2e-21) {
tmp = t_2;
} else if ((x * y) <= 4e+39) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = c + (a * (b * -0.25)) t_3 = c + (x * y) tmp = 0 if (x * y) <= -1e+162: tmp = t_3 elif (x * y) <= -2000000000000.0: tmp = t_1 elif (x * y) <= -2e-291: tmp = t_2 elif (x * y) <= 2e-303: tmp = t_1 elif (x * y) <= 2e-21: tmp = t_2 elif (x * y) <= 4e+39: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(c + Float64(a * Float64(b * -0.25))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1e+162) tmp = t_3; elseif (Float64(x * y) <= -2000000000000.0) tmp = t_1; elseif (Float64(x * y) <= -2e-291) tmp = t_2; elseif (Float64(x * y) <= 2e-303) tmp = t_1; elseif (Float64(x * y) <= 2e-21) tmp = t_2; elseif (Float64(x * y) <= 4e+39) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (t * (z * 0.0625)); t_2 = c + (a * (b * -0.25)); t_3 = c + (x * y); tmp = 0.0; if ((x * y) <= -1e+162) tmp = t_3; elseif ((x * y) <= -2000000000000.0) tmp = t_1; elseif ((x * y) <= -2e-291) tmp = t_2; elseif ((x * y) <= 2e-303) tmp = t_1; elseif ((x * y) <= 2e-21) tmp = t_2; elseif ((x * y) <= 4e+39) tmp = t_1; else tmp = t_3; 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]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+162], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2000000000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-291], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e-303], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-21], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4e+39], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+162}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -2000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-291}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e161 or 3.99999999999999976e39 < (*.f64 x y) Initial program 96.5%
Taylor expanded in x around inf 79.3%
if -9.9999999999999994e161 < (*.f64 x y) < -2e12 or -1.99999999999999992e-291 < (*.f64 x y) < 1.99999999999999986e-303 or 1.99999999999999982e-21 < (*.f64 x y) < 3.99999999999999976e39Initial program 98.8%
Taylor expanded in z around inf 73.7%
associate-*r*73.7%
*-commutative73.7%
associate-*r*73.7%
Simplified73.7%
if -2e12 < (*.f64 x y) < -1.99999999999999992e-291 or 1.99999999999999986e-303 < (*.f64 x y) < 1.99999999999999982e-21Initial program 97.6%
Taylor expanded in a around inf 73.8%
*-commutative73.8%
associate-*r*73.8%
Simplified73.8%
Final simplification75.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))) (t_2 (* (* a b) -0.25)))
(if (<= (* x y) -1.8e+155)
(* x y)
(if (<= (* x y) -2900000000.0)
t_1
(if (<= (* x y) -5.5e-298)
t_2
(if (<= (* x y) 1.4e-302)
t_1
(if (<= (* x y) 1.4e-19)
t_2
(if (<= (* x y) 6e+41) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double t_2 = (a * b) * -0.25;
double tmp;
if ((x * y) <= -1.8e+155) {
tmp = x * y;
} else if ((x * y) <= -2900000000.0) {
tmp = t_1;
} else if ((x * y) <= -5.5e-298) {
tmp = t_2;
} else if ((x * y) <= 1.4e-302) {
tmp = t_1;
} else if ((x * y) <= 1.4e-19) {
tmp = t_2;
} else if ((x * y) <= 6e+41) {
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) :: t_2
real(8) :: tmp
t_1 = t * (z * 0.0625d0)
t_2 = (a * b) * (-0.25d0)
if ((x * y) <= (-1.8d+155)) then
tmp = x * y
else if ((x * y) <= (-2900000000.0d0)) then
tmp = t_1
else if ((x * y) <= (-5.5d-298)) then
tmp = t_2
else if ((x * y) <= 1.4d-302) then
tmp = t_1
else if ((x * y) <= 1.4d-19) then
tmp = t_2
else if ((x * y) <= 6d+41) 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 = t * (z * 0.0625);
double t_2 = (a * b) * -0.25;
double tmp;
if ((x * y) <= -1.8e+155) {
tmp = x * y;
} else if ((x * y) <= -2900000000.0) {
tmp = t_1;
} else if ((x * y) <= -5.5e-298) {
tmp = t_2;
} else if ((x * y) <= 1.4e-302) {
tmp = t_1;
} else if ((x * y) <= 1.4e-19) {
tmp = t_2;
} else if ((x * y) <= 6e+41) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) t_2 = (a * b) * -0.25 tmp = 0 if (x * y) <= -1.8e+155: tmp = x * y elif (x * y) <= -2900000000.0: tmp = t_1 elif (x * y) <= -5.5e-298: tmp = t_2 elif (x * y) <= 1.4e-302: tmp = t_1 elif (x * y) <= 1.4e-19: tmp = t_2 elif (x * y) <= 6e+41: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) t_2 = Float64(Float64(a * b) * -0.25) tmp = 0.0 if (Float64(x * y) <= -1.8e+155) tmp = Float64(x * y); elseif (Float64(x * y) <= -2900000000.0) tmp = t_1; elseif (Float64(x * y) <= -5.5e-298) tmp = t_2; elseif (Float64(x * y) <= 1.4e-302) tmp = t_1; elseif (Float64(x * y) <= 1.4e-19) tmp = t_2; elseif (Float64(x * y) <= 6e+41) 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 = t * (z * 0.0625); t_2 = (a * b) * -0.25; tmp = 0.0; if ((x * y) <= -1.8e+155) tmp = x * y; elseif ((x * y) <= -2900000000.0) tmp = t_1; elseif ((x * y) <= -5.5e-298) tmp = t_2; elseif ((x * y) <= 1.4e-302) tmp = t_1; elseif ((x * y) <= 1.4e-19) tmp = t_2; elseif ((x * y) <= 6e+41) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e+155], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2900000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5.5e-298], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-302], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-19], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 6e+41], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+155}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2900000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-298}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.80000000000000004e155 or 5.9999999999999997e41 < (*.f64 x y) Initial program 96.5%
Taylor expanded in z around 0 88.5%
Taylor expanded in x around inf 71.8%
if -1.80000000000000004e155 < (*.f64 x y) < -2.9e9 or -5.4999999999999996e-298 < (*.f64 x y) < 1.4e-302 or 1.40000000000000001e-19 < (*.f64 x y) < 5.9999999999999997e41Initial program 98.8%
Taylor expanded in z around inf 74.0%
associate-*r*74.0%
*-commutative74.0%
associate-*r*74.0%
Simplified74.0%
Taylor expanded in t around inf 48.8%
associate-*r*48.8%
*-commutative48.8%
associate-*r*48.8%
Simplified48.8%
if -2.9e9 < (*.f64 x y) < -5.4999999999999996e-298 or 1.4e-302 < (*.f64 x y) < 1.40000000000000001e-19Initial program 97.6%
Taylor expanded in z around 0 81.0%
Taylor expanded in a around inf 47.3%
*-commutative47.3%
Simplified47.3%
Final simplification56.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25)))
(t_2 (* t (+ (* z 0.0625) (/ c t)))))
(if (<= t -5.6e-34)
t_2
(if (<= t 2.7e-110)
t_1
(if (<= t 6.6e-15)
(+ c (* x y))
(if (<= t 7.4e+49)
t_1
(if (<= t 2.3e+81)
(+ c (* t (* z 0.0625)))
(if (<= t 1.5e+170) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double t_2 = t * ((z * 0.0625) + (c / t));
double tmp;
if (t <= -5.6e-34) {
tmp = t_2;
} else if (t <= 2.7e-110) {
tmp = t_1;
} else if (t <= 6.6e-15) {
tmp = c + (x * y);
} else if (t <= 7.4e+49) {
tmp = t_1;
} else if (t <= 2.3e+81) {
tmp = c + (t * (z * 0.0625));
} else if (t <= 1.5e+170) {
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 = (x * y) - ((a * b) * 0.25d0)
t_2 = t * ((z * 0.0625d0) + (c / t))
if (t <= (-5.6d-34)) then
tmp = t_2
else if (t <= 2.7d-110) then
tmp = t_1
else if (t <= 6.6d-15) then
tmp = c + (x * y)
else if (t <= 7.4d+49) then
tmp = t_1
else if (t <= 2.3d+81) then
tmp = c + (t * (z * 0.0625d0))
else if (t <= 1.5d+170) 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 = (x * y) - ((a * b) * 0.25);
double t_2 = t * ((z * 0.0625) + (c / t));
double tmp;
if (t <= -5.6e-34) {
tmp = t_2;
} else if (t <= 2.7e-110) {
tmp = t_1;
} else if (t <= 6.6e-15) {
tmp = c + (x * y);
} else if (t <= 7.4e+49) {
tmp = t_1;
} else if (t <= 2.3e+81) {
tmp = c + (t * (z * 0.0625));
} else if (t <= 1.5e+170) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) t_2 = t * ((z * 0.0625) + (c / t)) tmp = 0 if t <= -5.6e-34: tmp = t_2 elif t <= 2.7e-110: tmp = t_1 elif t <= 6.6e-15: tmp = c + (x * y) elif t <= 7.4e+49: tmp = t_1 elif t <= 2.3e+81: tmp = c + (t * (z * 0.0625)) elif t <= 1.5e+170: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) t_2 = Float64(t * Float64(Float64(z * 0.0625) + Float64(c / t))) tmp = 0.0 if (t <= -5.6e-34) tmp = t_2; elseif (t <= 2.7e-110) tmp = t_1; elseif (t <= 6.6e-15) tmp = Float64(c + Float64(x * y)); elseif (t <= 7.4e+49) tmp = t_1; elseif (t <= 2.3e+81) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (t <= 1.5e+170) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((a * b) * 0.25); t_2 = t * ((z * 0.0625) + (c / t)); tmp = 0.0; if (t <= -5.6e-34) tmp = t_2; elseif (t <= 2.7e-110) tmp = t_1; elseif (t <= 6.6e-15) tmp = c + (x * y); elseif (t <= 7.4e+49) tmp = t_1; elseif (t <= 2.3e+81) tmp = c + (t * (z * 0.0625)); elseif (t <= 1.5e+170) 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[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(z * 0.0625), $MachinePrecision] + N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e-34], t$95$2, If[LessEqual[t, 2.7e-110], t$95$1, If[LessEqual[t, 6.6e-15], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.4e+49], t$95$1, If[LessEqual[t, 2.3e+81], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+170], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
t_2 := t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-15}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+81}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -5.59999999999999994e-34 or 1.49999999999999998e170 < t Initial program 95.3%
Taylor expanded in z around inf 66.1%
associate-*r*66.1%
*-commutative66.1%
associate-*r*66.1%
Simplified66.1%
Taylor expanded in t around inf 66.1%
if -5.59999999999999994e-34 < t < 2.6999999999999998e-110 or 6.6e-15 < t < 7.40000000000000036e49 or 2.2999999999999999e81 < t < 1.49999999999999998e170Initial program 99.3%
Taylor expanded in z around 0 88.0%
Taylor expanded in c around 0 71.4%
if 2.6999999999999998e-110 < t < 6.6e-15Initial program 95.6%
Taylor expanded in x around inf 73.5%
if 7.40000000000000036e49 < t < 2.2999999999999999e81Initial program 100.0%
Taylor expanded in z around inf 88.5%
associate-*r*88.5%
*-commutative88.5%
associate-*r*88.5%
Simplified88.5%
Final simplification70.3%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= (* a b) -6.5e+118)
(and (not (<= (* a b) 2.3e+89))
(or (<= (* a b) 1.22e+123) (not (<= (* a b) 6.2e+165)))))
(* (* a b) -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 * b) <= -6.5e+118) || (!((a * b) <= 2.3e+89) && (((a * b) <= 1.22e+123) || !((a * b) <= 6.2e+165)))) {
tmp = (a * b) * -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 * b) <= (-6.5d+118)) .or. (.not. ((a * b) <= 2.3d+89)) .and. ((a * b) <= 1.22d+123) .or. (.not. ((a * b) <= 6.2d+165))) then
tmp = (a * b) * (-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 * b) <= -6.5e+118) || (!((a * b) <= 2.3e+89) && (((a * b) <= 1.22e+123) || !((a * b) <= 6.2e+165)))) {
tmp = (a * b) * -0.25;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -6.5e+118) or (not ((a * b) <= 2.3e+89) and (((a * b) <= 1.22e+123) or not ((a * b) <= 6.2e+165))): tmp = (a * b) * -0.25 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -6.5e+118) || (!(Float64(a * b) <= 2.3e+89) && ((Float64(a * b) <= 1.22e+123) || !(Float64(a * b) <= 6.2e+165)))) tmp = Float64(Float64(a * b) * -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 * b) <= -6.5e+118) || (~(((a * b) <= 2.3e+89)) && (((a * b) <= 1.22e+123) || ~(((a * b) <= 6.2e+165))))) tmp = (a * b) * -0.25; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -6.5e+118], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.3e+89]], $MachinePrecision], Or[LessEqual[N[(a * b), $MachinePrecision], 1.22e+123], N[Not[LessEqual[N[(a * b), $MachinePrecision], 6.2e+165]], $MachinePrecision]]]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6.5 \cdot 10^{+118} \lor \neg \left(a \cdot b \leq 2.3 \cdot 10^{+89}\right) \land \left(a \cdot b \leq 1.22 \cdot 10^{+123} \lor \neg \left(a \cdot b \leq 6.2 \cdot 10^{+165}\right)\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 a b) < -6.5e118 or 2.2999999999999999e89 < (*.f64 a b) < 1.22e123 or 6.2000000000000003e165 < (*.f64 a b) Initial program 94.1%
Taylor expanded in z around 0 84.2%
Taylor expanded in a around inf 72.9%
*-commutative72.9%
Simplified72.9%
if -6.5e118 < (*.f64 a b) < 2.2999999999999999e89 or 1.22e123 < (*.f64 a b) < 6.2000000000000003e165Initial program 99.4%
Taylor expanded in x around inf 63.1%
Final simplification66.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))) (t_2 (+ c (* x y))))
(if (<= (* x y) -1e+162)
t_2
(if (<= (* x y) -1e+36)
t_1
(if (<= (* x y) 2e-21)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 4e+39) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1e+162) {
tmp = t_2;
} else if ((x * y) <= -1e+36) {
tmp = t_1;
} else if ((x * y) <= 2e-21) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+39) {
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 = t * (z * 0.0625d0)
t_2 = c + (x * y)
if ((x * y) <= (-1d+162)) then
tmp = t_2
else if ((x * y) <= (-1d+36)) then
tmp = t_1
else if ((x * y) <= 2d-21) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 4d+39) 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 = t * (z * 0.0625);
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1e+162) {
tmp = t_2;
} else if ((x * y) <= -1e+36) {
tmp = t_1;
} else if ((x * y) <= 2e-21) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 4e+39) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) t_2 = c + (x * y) tmp = 0 if (x * y) <= -1e+162: tmp = t_2 elif (x * y) <= -1e+36: tmp = t_1 elif (x * y) <= 2e-21: tmp = c + (a * (b * -0.25)) elif (x * y) <= 4e+39: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1e+162) tmp = t_2; elseif (Float64(x * y) <= -1e+36) tmp = t_1; elseif (Float64(x * y) <= 2e-21) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 4e+39) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = t * (z * 0.0625); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -1e+162) tmp = t_2; elseif ((x * y) <= -1e+36) tmp = t_1; elseif ((x * y) <= 2e-21) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 4e+39) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+162], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1e+36], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-21], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+39], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+162}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-21}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e161 or 3.99999999999999976e39 < (*.f64 x y) Initial program 96.5%
Taylor expanded in x around inf 79.3%
if -9.9999999999999994e161 < (*.f64 x y) < -1.00000000000000004e36 or 1.99999999999999982e-21 < (*.f64 x y) < 3.99999999999999976e39Initial program 97.3%
Taylor expanded in z around inf 71.2%
associate-*r*71.2%
*-commutative71.2%
associate-*r*71.2%
Simplified71.2%
Taylor expanded in t around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
associate-*r*63.3%
Simplified63.3%
if -1.00000000000000004e36 < (*.f64 x y) < 1.99999999999999982e-21Initial program 98.5%
Taylor expanded in a around inf 69.1%
*-commutative69.1%
associate-*r*69.1%
Simplified69.1%
Final simplification71.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))))
(if (<= (* x y) -1.05e+155)
(* x y)
(if (<= (* x y) -5.6e-219)
t_1
(if (<= (* x y) 1.8e-30) c (if (<= (* x y) 4.6e+40) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double tmp;
if ((x * y) <= -1.05e+155) {
tmp = x * y;
} else if ((x * y) <= -5.6e-219) {
tmp = t_1;
} else if ((x * y) <= 1.8e-30) {
tmp = c;
} else if ((x * y) <= 4.6e+40) {
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 = t * (z * 0.0625d0)
if ((x * y) <= (-1.05d+155)) then
tmp = x * y
else if ((x * y) <= (-5.6d-219)) then
tmp = t_1
else if ((x * y) <= 1.8d-30) then
tmp = c
else if ((x * y) <= 4.6d+40) 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 = t * (z * 0.0625);
double tmp;
if ((x * y) <= -1.05e+155) {
tmp = x * y;
} else if ((x * y) <= -5.6e-219) {
tmp = t_1;
} else if ((x * y) <= 1.8e-30) {
tmp = c;
} else if ((x * y) <= 4.6e+40) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) tmp = 0 if (x * y) <= -1.05e+155: tmp = x * y elif (x * y) <= -5.6e-219: tmp = t_1 elif (x * y) <= 1.8e-30: tmp = c elif (x * y) <= 4.6e+40: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -1.05e+155) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.6e-219) tmp = t_1; elseif (Float64(x * y) <= 1.8e-30) tmp = c; elseif (Float64(x * y) <= 4.6e+40) 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 = t * (z * 0.0625); tmp = 0.0; if ((x * y) <= -1.05e+155) tmp = x * y; elseif ((x * y) <= -5.6e-219) tmp = t_1; elseif ((x * y) <= 1.8e-30) tmp = c; elseif ((x * y) <= 4.6e+40) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+155], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.6e-219], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.8e-30], c, If[LessEqual[N[(x * y), $MachinePrecision], 4.6e+40], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+155}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.6 \cdot 10^{-219}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.8 \cdot 10^{-30}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.05e155 or 4.59999999999999987e40 < (*.f64 x y) Initial program 96.5%
Taylor expanded in z around 0 88.5%
Taylor expanded in x around inf 71.8%
if -1.05e155 < (*.f64 x y) < -5.5999999999999998e-219 or 1.8000000000000002e-30 < (*.f64 x y) < 4.59999999999999987e40Initial program 96.5%
Taylor expanded in z around inf 59.0%
associate-*r*59.0%
*-commutative59.0%
associate-*r*59.0%
Simplified59.0%
Taylor expanded in t around inf 43.6%
associate-*r*43.6%
*-commutative43.6%
associate-*r*43.6%
Simplified43.6%
if -5.5999999999999998e-219 < (*.f64 x y) < 1.8000000000000002e-30Initial program 100.0%
Taylor expanded in c around inf 37.2%
Final simplification51.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -1e+124)
(- (+ c (* x y)) t_1)
(if (<= (* a b) 5e+33) (+ c (+ (* x y) t_2)) (- (+ c t_2) 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 t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+124) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 5e+33) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + t_2) - 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) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-1d+124)) then
tmp = (c + (x * y)) - t_1
else if ((a * b) <= 5d+33) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + t_2) - 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 t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+124) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 5e+33) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + t_2) - t_1;
}
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 (a * b) <= -1e+124: tmp = (c + (x * y)) - t_1 elif (a * b) <= 5e+33: tmp = c + ((x * y) + t_2) else: tmp = (c + t_2) - t_1 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 (Float64(a * b) <= -1e+124) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(a * b) <= 5e+33) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + t_2) - t_1); 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 ((a * b) <= -1e+124) tmp = (c + (x * y)) - t_1; elseif ((a * b) <= 5e+33) tmp = c + ((x * y) + t_2); else tmp = (c + t_2) - 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]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+124], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+33], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $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}\;a \cdot b \leq -1 \cdot 10^{+124}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+33}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t\_2\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999948e123Initial program 92.5%
Taylor expanded in z around 0 87.9%
if -9.99999999999999948e123 < (*.f64 a b) < 4.99999999999999973e33Initial program 99.3%
Taylor expanded in a around 0 94.4%
if 4.99999999999999973e33 < (*.f64 a b) Initial program 96.9%
Taylor expanded in x around 0 84.7%
Final simplification91.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+124) (not (<= (* a b) 2e+77))) (- (+ 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) <= -1e+124) || !((a * b) <= 2e+77)) {
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) <= (-1d+124)) .or. (.not. ((a * b) <= 2d+77))) 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) <= -1e+124) || !((a * b) <= 2e+77)) {
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) <= -1e+124) or not ((a * b) <= 2e+77): 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) <= -1e+124) || !(Float64(a * b) <= 2e+77)) 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) <= -1e+124) || ~(((a * b) <= 2e+77))) 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], -1e+124], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+77]], $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 -1 \cdot 10^{+124} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+77}\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) < -9.99999999999999948e123 or 1.99999999999999997e77 < (*.f64 a b) Initial program 94.7%
Taylor expanded in z around 0 83.7%
if -9.99999999999999948e123 < (*.f64 a b) < 1.99999999999999997e77Initial program 99.4%
Taylor expanded in a around 0 93.6%
Final simplification89.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -1e+124) (not (<= (* a b) 1e+165))) (- (* 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) <= -1e+124) || !((a * b) <= 1e+165)) {
tmp = (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) <= (-1d+124)) .or. (.not. ((a * b) <= 1d+165))) then
tmp = (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) <= -1e+124) || !((a * b) <= 1e+165)) {
tmp = (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) <= -1e+124) or not ((a * b) <= 1e+165): tmp = (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) <= -1e+124) || !(Float64(a * b) <= 1e+165)) tmp = Float64(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) <= -1e+124) || ~(((a * b) <= 1e+165))) tmp = (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], -1e+124], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+165]], $MachinePrecision]], N[(N[(x * y), $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 -1 \cdot 10^{+124} \lor \neg \left(a \cdot b \leq 10^{+165}\right):\\
\;\;\;\;x \cdot y - \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) < -9.99999999999999948e123 or 9.99999999999999899e164 < (*.f64 a b) Initial program 93.2%
Taylor expanded in z around 0 87.0%
Taylor expanded in c around 0 83.2%
if -9.99999999999999948e123 < (*.f64 a b) < 9.99999999999999899e164Initial program 99.4%
Taylor expanded in a around 0 91.1%
Final simplification88.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.25e+68) (not (<= (* x y) 2.5e-25))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.25e+68) || !((x * y) <= 2.5e-25)) {
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) <= (-2.25d+68)) .or. (.not. ((x * y) <= 2.5d-25))) 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) <= -2.25e+68) || !((x * y) <= 2.5e-25)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.25e+68) or not ((x * y) <= 2.5e-25): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.25e+68) || !(Float64(x * y) <= 2.5e-25)) 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) <= -2.25e+68) || ~(((x * y) <= 2.5e-25))) 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], -2.25e+68], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.5e-25]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+68} \lor \neg \left(x \cdot y \leq 2.5 \cdot 10^{-25}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.2500000000000002e68 or 2.49999999999999981e-25 < (*.f64 x y) Initial program 97.4%
Taylor expanded in z around 0 76.4%
Taylor expanded in x around inf 56.8%
if -2.2500000000000002e68 < (*.f64 x y) < 2.49999999999999981e-25Initial program 97.8%
Taylor expanded in c around inf 32.5%
Final simplification43.6%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 97.6%
Taylor expanded in c around inf 21.2%
herbie shell --seed 2024085
(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))