
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -1e+77)
(+ (+ x y) (* (+ a -0.5) b))
(if (<= t_1 1e+132)
(+ (* z (- 1.0 (log t))) (+ x y))
(+ (+ x y) (+ (* a b) (* -0.5 b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -1e+77) {
tmp = (x + y) + ((a + -0.5) * b);
} else if (t_1 <= 1e+132) {
tmp = (z * (1.0 - log(t))) + (x + y);
} else {
tmp = (x + y) + ((a * b) + (-0.5 * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (t_1 <= (-1d+77)) then
tmp = (x + y) + ((a + (-0.5d0)) * b)
else if (t_1 <= 1d+132) then
tmp = (z * (1.0d0 - log(t))) + (x + y)
else
tmp = (x + y) + ((a * b) + ((-0.5d0) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -1e+77) {
tmp = (x + y) + ((a + -0.5) * b);
} else if (t_1 <= 1e+132) {
tmp = (z * (1.0 - Math.log(t))) + (x + y);
} else {
tmp = (x + y) + ((a * b) + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -1e+77: tmp = (x + y) + ((a + -0.5) * b) elif t_1 <= 1e+132: tmp = (z * (1.0 - math.log(t))) + (x + y) else: tmp = (x + y) + ((a * b) + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -1e+77) tmp = Float64(Float64(x + y) + Float64(Float64(a + -0.5) * b)); elseif (t_1 <= 1e+132) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(x + y)); else tmp = Float64(Float64(x + y) + Float64(Float64(a * b) + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (t_1 <= -1e+77) tmp = (x + y) + ((a + -0.5) * b); elseif (t_1 <= 1e+132) tmp = (z * (1.0 - log(t))) + (x + y); else tmp = (x + y) + ((a * b) + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+77], N[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+132], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+77}:\\
\;\;\;\;\left(x + y\right) + \left(a + -0.5\right) \cdot b\\
\mathbf{elif}\;t\_1 \leq 10^{+132}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(a \cdot b + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.99999999999999983e76Initial program 99.9%
Taylor expanded in z around inf 63.5%
associate--l+63.5%
sub-neg63.5%
metadata-eval63.5%
associate-/l*63.3%
+-commutative63.3%
Simplified63.3%
Taylor expanded in z around 0 95.1%
associate-+r+95.1%
sub-neg95.1%
metadata-eval95.1%
+-commutative95.1%
Simplified95.1%
if -9.99999999999999983e76 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.99999999999999991e131Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 93.0%
if 9.99999999999999991e131 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around inf 73.0%
associate--l+73.0%
sub-neg73.0%
metadata-eval73.0%
associate-/l*72.9%
+-commutative72.9%
Simplified72.9%
Taylor expanded in z around 0 88.8%
associate-+r+88.8%
sub-neg88.8%
metadata-eval88.8%
+-commutative88.8%
Simplified88.8%
distribute-rgt-in88.8%
+-commutative88.8%
*-commutative88.8%
*-commutative88.8%
Applied egg-rr88.8%
Final simplification92.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -5e+125) (+ x t_1) (- (+ y (+ z t_1)) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e+125) {
tmp = x + t_1;
} else {
tmp = (y + (z + t_1)) - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-5d+125)) then
tmp = x + t_1
else
tmp = (y + (z + t_1)) - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e+125) {
tmp = x + t_1;
} else {
tmp = (y + (z + t_1)) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -5e+125: tmp = x + t_1 else: tmp = (y + (z + t_1)) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -5e+125) tmp = Float64(x + t_1); else tmp = Float64(Float64(y + Float64(z + t_1)) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -5e+125) tmp = x + t_1; else tmp = (y + (z + t_1)) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e+125], N[(x + t$95$1), $MachinePrecision], N[(N[(y + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{+125}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + t\_1\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if (+.f64 x y) < -4.99999999999999962e125Initial program 99.9%
Taylor expanded in x around inf 77.2%
associate--l+77.2%
associate-/l*77.2%
Simplified77.2%
Taylor expanded in x around inf 57.3%
if -4.99999999999999962e125 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 85.7%
Final simplification76.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= (+ x y) -2e-20)
(- (+ (+ z x) (* (+ a -0.5) b)) t_1)
(- (+ y (+ z (* b (- a 0.5)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double tmp;
if ((x + y) <= -2e-20) {
tmp = ((z + x) + ((a + -0.5) * b)) - t_1;
} else {
tmp = (y + (z + (b * (a - 0.5)))) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = z * log(t)
if ((x + y) <= (-2d-20)) then
tmp = ((z + x) + ((a + (-0.5d0)) * b)) - t_1
else
tmp = (y + (z + (b * (a - 0.5d0)))) - 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 t_1 = z * Math.log(t);
double tmp;
if ((x + y) <= -2e-20) {
tmp = ((z + x) + ((a + -0.5) * b)) - t_1;
} else {
tmp = (y + (z + (b * (a - 0.5)))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if (x + y) <= -2e-20: tmp = ((z + x) + ((a + -0.5) * b)) - t_1 else: tmp = (y + (z + (b * (a - 0.5)))) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (Float64(x + y) <= -2e-20) tmp = Float64(Float64(Float64(z + x) + Float64(Float64(a + -0.5) * b)) - t_1); else tmp = Float64(Float64(y + Float64(z + Float64(b * Float64(a - 0.5)))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); tmp = 0.0; if ((x + y) <= -2e-20) tmp = ((z + x) + ((a + -0.5) * b)) - t_1; else tmp = (y + (z + (b * (a - 0.5)))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -2e-20], N[(N[(N[(z + x), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;x + y \leq -2 \cdot 10^{-20}:\\
\;\;\;\;\left(\left(z + x\right) + \left(a + -0.5\right) \cdot b\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -1.99999999999999989e-20Initial program 99.8%
Taylor expanded in y around 0 72.7%
associate-+r+72.7%
+-commutative72.7%
sub-neg72.7%
metadata-eval72.7%
+-commutative72.7%
Simplified72.7%
if -1.99999999999999989e-20 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 83.9%
Final simplification78.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -3e+206)
(+ t_1 x)
(if (<= z 1.5e+194)
(+ (+ x y) (+ (* a b) (* -0.5 b)))
(+ t_1 (* -0.5 b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -3e+206) {
tmp = t_1 + x;
} else if (z <= 1.5e+194) {
tmp = (x + y) + ((a * b) + (-0.5 * b));
} else {
tmp = t_1 + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-3d+206)) then
tmp = t_1 + x
else if (z <= 1.5d+194) then
tmp = (x + y) + ((a * b) + ((-0.5d0) * b))
else
tmp = t_1 + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -3e+206) {
tmp = t_1 + x;
} else if (z <= 1.5e+194) {
tmp = (x + y) + ((a * b) + (-0.5 * b));
} else {
tmp = t_1 + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -3e+206: tmp = t_1 + x elif z <= 1.5e+194: tmp = (x + y) + ((a * b) + (-0.5 * b)) else: tmp = t_1 + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -3e+206) tmp = Float64(t_1 + x); elseif (z <= 1.5e+194) tmp = Float64(Float64(x + y) + Float64(Float64(a * b) + Float64(-0.5 * b))); else tmp = Float64(t_1 + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -3e+206) tmp = t_1 + x; elseif (z <= 1.5e+194) tmp = (x + y) + ((a * b) + (-0.5 * b)); else tmp = t_1 + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+206], N[(t$95$1 + x), $MachinePrecision], If[LessEqual[z, 1.5e+194], N[(N[(x + y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+206}:\\
\;\;\;\;t\_1 + x\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) + \left(a \cdot b + -0.5 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + -0.5 \cdot b\\
\end{array}
\end{array}
if z < -3.0000000000000001e206Initial program 99.5%
+-commutative99.5%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 70.7%
if -3.0000000000000001e206 < z < 1.5000000000000002e194Initial program 99.9%
Taylor expanded in z around inf 63.8%
associate--l+63.8%
sub-neg63.8%
metadata-eval63.8%
associate-/l*62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in z around 0 90.6%
associate-+r+90.6%
sub-neg90.6%
metadata-eval90.6%
+-commutative90.6%
Simplified90.6%
distribute-rgt-in90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
Applied egg-rr90.6%
if 1.5000000000000002e194 < z Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around inf 89.5%
Taylor expanded in a around 0 84.9%
Final simplification88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -1.16e+103)
(+ t_1 (* a b))
(if (<= z 7.8e+194)
(+ (+ x y) (+ (* a b) (* -0.5 b)))
(+ t_1 (* -0.5 b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -1.16e+103) {
tmp = t_1 + (a * b);
} else if (z <= 7.8e+194) {
tmp = (x + y) + ((a * b) + (-0.5 * b));
} else {
tmp = t_1 + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-1.16d+103)) then
tmp = t_1 + (a * b)
else if (z <= 7.8d+194) then
tmp = (x + y) + ((a * b) + ((-0.5d0) * b))
else
tmp = t_1 + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -1.16e+103) {
tmp = t_1 + (a * b);
} else if (z <= 7.8e+194) {
tmp = (x + y) + ((a * b) + (-0.5 * b));
} else {
tmp = t_1 + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -1.16e+103: tmp = t_1 + (a * b) elif z <= 7.8e+194: tmp = (x + y) + ((a * b) + (-0.5 * b)) else: tmp = t_1 + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -1.16e+103) tmp = Float64(t_1 + Float64(a * b)); elseif (z <= 7.8e+194) tmp = Float64(Float64(x + y) + Float64(Float64(a * b) + Float64(-0.5 * b))); else tmp = Float64(t_1 + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -1.16e+103) tmp = t_1 + (a * b); elseif (z <= 7.8e+194) tmp = (x + y) + ((a * b) + (-0.5 * b)); else tmp = t_1 + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.16e+103], N[(t$95$1 + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+194], N[(N[(x + y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.16 \cdot 10^{+103}:\\
\;\;\;\;t\_1 + a \cdot b\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) + \left(a \cdot b + -0.5 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + -0.5 \cdot b\\
\end{array}
\end{array}
if z < -1.1600000000000001e103Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 68.2%
*-commutative68.2%
Simplified68.2%
if -1.1600000000000001e103 < z < 7.80000000000000031e194Initial program 99.9%
Taylor expanded in z around inf 60.2%
associate--l+60.2%
sub-neg60.2%
metadata-eval60.2%
associate-/l*59.1%
+-commutative59.1%
Simplified59.1%
Taylor expanded in z around 0 93.3%
associate-+r+93.3%
sub-neg93.3%
metadata-eval93.3%
+-commutative93.3%
Simplified93.3%
distribute-rgt-in93.3%
+-commutative93.3%
*-commutative93.3%
*-commutative93.3%
Applied egg-rr93.3%
if 7.80000000000000031e194 < z Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around inf 89.5%
Taylor expanded in a around 0 84.9%
Final simplification88.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.5e+208) (not (<= z 1.35e+195))) (+ (* z (- 1.0 (log t))) x) (+ (+ x y) (+ (* a b) (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.5e+208) || !(z <= 1.35e+195)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = (x + y) + ((a * b) + (-0.5 * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((z <= (-6.5d+208)) .or. (.not. (z <= 1.35d+195))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = (x + y) + ((a * b) + ((-0.5d0) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.5e+208) || !(z <= 1.35e+195)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = (x + y) + ((a * b) + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.5e+208) or not (z <= 1.35e+195): tmp = (z * (1.0 - math.log(t))) + x else: tmp = (x + y) + ((a * b) + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.5e+208) || !(z <= 1.35e+195)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(Float64(x + y) + Float64(Float64(a * b) + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.5e+208) || ~((z <= 1.35e+195))) tmp = (z * (1.0 - log(t))) + x; else tmp = (x + y) + ((a * b) + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.5e+208], N[Not[LessEqual[z, 1.35e+195]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+208} \lor \neg \left(z \leq 1.35 \cdot 10^{+195}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(a \cdot b + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if z < -6.5000000000000001e208 or 1.3500000000000001e195 < z Initial program 99.5%
+-commutative99.5%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 74.3%
if -6.5000000000000001e208 < z < 1.3500000000000001e195Initial program 99.9%
Taylor expanded in z around inf 63.8%
associate--l+63.8%
sub-neg63.8%
metadata-eval63.8%
associate-/l*62.7%
+-commutative62.7%
Simplified62.7%
Taylor expanded in z around 0 90.6%
associate-+r+90.6%
sub-neg90.6%
metadata-eval90.6%
+-commutative90.6%
Simplified90.6%
distribute-rgt-in90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
Applied egg-rr90.6%
Final simplification87.8%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
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
code = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z 2.1e+194) (+ (+ x y) (+ (* a b) (* -0.5 b))) (* z (- 1.0 (log t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.1e+194) {
tmp = (x + y) + ((a * b) + (-0.5 * b));
} else {
tmp = z * (1.0 - log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= 2.1d+194) then
tmp = (x + y) + ((a * b) + ((-0.5d0) * b))
else
tmp = z * (1.0d0 - log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.1e+194) {
tmp = (x + y) + ((a * b) + (-0.5 * b));
} else {
tmp = z * (1.0 - Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 2.1e+194: tmp = (x + y) + ((a * b) + (-0.5 * b)) else: tmp = z * (1.0 - math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.1e+194) tmp = Float64(Float64(x + y) + Float64(Float64(a * b) + Float64(-0.5 * b))); else tmp = Float64(z * Float64(1.0 - log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 2.1e+194) tmp = (x + y) + ((a * b) + (-0.5 * b)); else tmp = z * (1.0 - log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.1e+194], N[(N[(x + y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.1 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) + \left(a \cdot b + -0.5 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < 2.10000000000000016e194Initial program 99.9%
Taylor expanded in z around inf 67.3%
associate--l+67.3%
sub-neg67.3%
metadata-eval67.3%
associate-/l*66.4%
+-commutative66.4%
Simplified66.4%
Taylor expanded in z around 0 85.9%
associate-+r+85.9%
sub-neg85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
distribute-rgt-in85.9%
+-commutative85.9%
*-commutative85.9%
*-commutative85.9%
Applied egg-rr85.9%
if 2.10000000000000016e194 < z Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 78.0%
Taylor expanded in z around inf 73.7%
Final simplification84.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -2e+22) (not (<= t_1 5e+76))) (+ x t_1) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+22) || !(t_1 <= 5e+76)) {
tmp = x + t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-2d+22)) .or. (.not. (t_1 <= 5d+76))) then
tmp = x + 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 t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+22) || !(t_1 <= 5e+76)) {
tmp = x + t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+22) or not (t_1 <= 5e+76): tmp = x + t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -2e+22) || !(t_1 <= 5e+76)) tmp = Float64(x + t_1); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -2e+22) || ~((t_1 <= 5e+76))) tmp = x + t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+22], N[Not[LessEqual[t$95$1, 5e+76]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+22} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+76}\right):\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2e22 or 4.99999999999999991e76 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in x around inf 77.7%
associate--l+77.7%
associate-/l*77.7%
Simplified77.7%
Taylor expanded in x around inf 75.6%
if -2e22 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 4.99999999999999991e76Initial program 99.8%
Taylor expanded in z around inf 69.0%
associate--l+69.0%
sub-neg69.0%
metadata-eval69.0%
associate-/l*68.9%
+-commutative68.9%
Simplified68.9%
Taylor expanded in z around 0 74.3%
associate-+r+74.3%
sub-neg74.3%
metadata-eval74.3%
+-commutative74.3%
Simplified74.3%
Taylor expanded in b around 0 72.0%
+-commutative72.0%
Simplified72.0%
Final simplification74.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -35000000000000.0) (not (<= b 1.2e+32))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -35000000000000.0) || !(b <= 1.2e+32)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((b <= (-35000000000000.0d0)) .or. (.not. (b <= 1.2d+32))) then
tmp = b * (a - 0.5d0)
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 tmp;
if ((b <= -35000000000000.0) || !(b <= 1.2e+32)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -35000000000000.0) or not (b <= 1.2e+32): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -35000000000000.0) || !(b <= 1.2e+32)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -35000000000000.0) || ~((b <= 1.2e+32))) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -35000000000000.0], N[Not[LessEqual[b, 1.2e+32]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -35000000000000 \lor \neg \left(b \leq 1.2 \cdot 10^{+32}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -3.5e13 or 1.19999999999999996e32 < b Initial program 99.9%
Taylor expanded in z around inf 68.7%
associate--l+68.7%
sub-neg68.7%
metadata-eval68.7%
associate-/l*68.6%
+-commutative68.6%
Simplified68.6%
Taylor expanded in b around -inf 72.0%
if -3.5e13 < b < 1.19999999999999996e32Initial program 99.8%
Taylor expanded in z around inf 71.4%
associate--l+71.4%
sub-neg71.4%
metadata-eval71.4%
associate-/l*69.8%
+-commutative69.8%
Simplified69.8%
Taylor expanded in z around 0 74.5%
associate-+r+74.5%
sub-neg74.5%
metadata-eval74.5%
+-commutative74.5%
Simplified74.5%
Taylor expanded in b around 0 67.7%
+-commutative67.7%
Simplified67.7%
Final simplification69.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 5e-145) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 5e-145) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= 5d-145) then
tmp = x + t_1
else
tmp = y + 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 t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= 5e-145) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= 5e-145: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= 5e-145) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= 5e-145) tmp = x + t_1; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 5e-145], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq 5 \cdot 10^{-145}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 4.9999999999999998e-145Initial program 99.8%
Taylor expanded in x around inf 77.3%
associate--l+77.3%
associate-/l*77.3%
Simplified77.3%
Taylor expanded in x around inf 56.2%
if 4.9999999999999998e-145 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around inf 83.8%
associate--l+83.8%
associate-/l*83.8%
Simplified83.8%
Taylor expanded in y around inf 64.5%
Final simplification59.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.6e+58) (not (<= a 4.6e+114))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.6e+58) || !(a <= 4.6e+114)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((a <= (-6.6d+58)) .or. (.not. (a <= 4.6d+114))) then
tmp = a * b
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 tmp;
if ((a <= -6.6e+58) || !(a <= 4.6e+114)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.6e+58) or not (a <= 4.6e+114): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.6e+58) || !(a <= 4.6e+114)) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -6.6e+58) || ~((a <= 4.6e+114))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.6e+58], N[Not[LessEqual[a, 4.6e+114]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.6 \cdot 10^{+58} \lor \neg \left(a \leq 4.6 \cdot 10^{+114}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -6.59999999999999966e58 or 4.6000000000000001e114 < a Initial program 99.9%
Taylor expanded in z around inf 73.8%
associate--l+73.8%
sub-neg73.8%
metadata-eval73.8%
associate-/l*71.4%
+-commutative71.4%
Simplified71.4%
Taylor expanded in z around 0 89.3%
associate-+r+89.3%
sub-neg89.3%
metadata-eval89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in a around inf 65.9%
*-commutative65.9%
Simplified65.9%
if -6.59999999999999966e58 < a < 4.6000000000000001e114Initial program 99.8%
Taylor expanded in z around inf 68.1%
associate--l+68.1%
sub-neg68.1%
metadata-eval68.1%
associate-/l*68.1%
+-commutative68.1%
Simplified68.1%
Taylor expanded in z around 0 75.9%
associate-+r+75.9%
sub-neg75.9%
metadata-eval75.9%
+-commutative75.9%
Simplified75.9%
Taylor expanded in b around 0 54.4%
+-commutative54.4%
Simplified54.4%
Final simplification58.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.95e-145) x (if (<= y 2.9e+206) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.95e-145) {
tmp = x;
} else if (y <= 2.9e+206) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y <= 1.95d-145) then
tmp = x
else if (y <= 2.9d+206) then
tmp = a * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.95e-145) {
tmp = x;
} else if (y <= 2.9e+206) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.95e-145: tmp = x elif y <= 2.9e+206: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.95e-145) tmp = x; elseif (y <= 2.9e+206) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.95e-145) tmp = x; elseif (y <= 2.9e+206) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.95e-145], x, If[LessEqual[y, 2.9e+206], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.95 \cdot 10^{-145}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+206}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 1.95000000000000015e-145Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 42.6%
Taylor expanded in z around 0 22.8%
if 1.95000000000000015e-145 < y < 2.9e206Initial program 99.8%
Taylor expanded in z around inf 75.4%
associate--l+75.4%
sub-neg75.4%
metadata-eval75.4%
associate-/l*75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in z around 0 81.8%
associate-+r+81.8%
sub-neg81.8%
metadata-eval81.8%
+-commutative81.8%
Simplified81.8%
Taylor expanded in a around inf 38.2%
*-commutative38.2%
Simplified38.2%
if 2.9e206 < y Initial program 99.9%
Taylor expanded in z around inf 60.2%
associate--l+60.2%
sub-neg60.2%
metadata-eval60.2%
associate-/l*59.8%
+-commutative59.8%
Simplified59.8%
Taylor expanded in y around inf 72.1%
Final simplification31.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (+ (* a b) (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a * b) + (-0.5 * b));
}
real(8) function code(x, y, z, t, a, b)
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
code = (x + y) + ((a * b) + ((-0.5d0) * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a * b) + (-0.5 * b));
}
def code(x, y, z, t, a, b): return (x + y) + ((a * b) + (-0.5 * b))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(Float64(a * b) + Float64(-0.5 * b))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + ((a * b) + (-0.5 * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + \left(a \cdot b + -0.5 \cdot b\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around inf 70.1%
associate--l+70.1%
sub-neg70.1%
metadata-eval70.1%
associate-/l*69.2%
+-commutative69.2%
Simplified69.2%
Taylor expanded in z around 0 80.7%
associate-+r+80.7%
sub-neg80.7%
metadata-eval80.7%
+-commutative80.7%
Simplified80.7%
distribute-rgt-in80.7%
+-commutative80.7%
*-commutative80.7%
*-commutative80.7%
Applied egg-rr80.7%
Final simplification80.7%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* (+ a -0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a + -0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = (x + y) + ((a + (-0.5d0)) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a + -0.5) * b);
}
def code(x, y, z, t, a, b): return (x + y) + ((a + -0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(Float64(a + -0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + ((a + -0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + \left(a + -0.5\right) \cdot b
\end{array}
Initial program 99.9%
Taylor expanded in z around inf 70.1%
associate--l+70.1%
sub-neg70.1%
metadata-eval70.1%
associate-/l*69.2%
+-commutative69.2%
Simplified69.2%
Taylor expanded in z around 0 80.7%
associate-+r+80.7%
sub-neg80.7%
metadata-eval80.7%
+-commutative80.7%
Simplified80.7%
Final simplification80.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.15e+14) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.15e+14) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-2.15d+14)) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.15e+14) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.15e+14: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.15e+14) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.15e+14) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.15e+14], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.15e14Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 58.1%
Taylor expanded in z around 0 45.2%
if -2.15e14 < x Initial program 99.9%
Taylor expanded in z around inf 72.2%
associate--l+72.2%
sub-neg72.2%
metadata-eval72.2%
associate-/l*71.6%
+-commutative71.6%
Simplified71.6%
Taylor expanded in y around inf 27.5%
Final simplification31.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
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
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 39.4%
Taylor expanded in z around 0 20.8%
Final simplification20.8%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024078
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))