
(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 20 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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -4e+96) (not (<= t_1 2e+122)))
(+ (+ x y) t_1)
(+ (* z (- 1.0 (log t))) (+ 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 <= -4e+96) || !(t_1 <= 2e+122)) {
tmp = (x + y) + t_1;
} else {
tmp = (z * (1.0 - log(t))) + (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 <= (-4d+96)) .or. (.not. (t_1 <= 2d+122))) then
tmp = (x + y) + t_1
else
tmp = (z * (1.0d0 - log(t))) + (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 <= -4e+96) || !(t_1 <= 2e+122)) {
tmp = (x + y) + t_1;
} else {
tmp = (z * (1.0 - Math.log(t))) + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -4e+96) or not (t_1 <= 2e+122): tmp = (x + y) + t_1 else: tmp = (z * (1.0 - math.log(t))) + (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 <= -4e+96) || !(t_1 <= 2e+122)) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(Float64(z * Float64(1.0 - log(t))) + 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 <= -4e+96) || ~((t_1 <= 2e+122))) tmp = (x + y) + t_1; else tmp = (z * (1.0 - log(t))) + (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, -4e+96], N[Not[LessEqual[t$95$1, 2e+122]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+96} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+122}\right):\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.0000000000000002e96 or 2.00000000000000003e122 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
add-cube-cbrt99.8%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 93.8%
if -4.0000000000000002e96 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.00000000000000003e122Initial 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.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 94.3%
Final simplification94.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5)))) (if (<= (+ x y) -2e-123) (+ t_2 (- (+ z x) t_1)) (+ t_2 (- (+ z y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if ((x + y) <= -2e-123) {
tmp = t_2 + ((z + x) - t_1);
} else {
tmp = t_2 + ((z + 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) :: t_2
real(8) :: tmp
t_1 = z * log(t)
t_2 = b * (a - 0.5d0)
if ((x + y) <= (-2d-123)) then
tmp = t_2 + ((z + x) - t_1)
else
tmp = t_2 + ((z + 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 = z * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if ((x + y) <= -2e-123) {
tmp = t_2 + ((z + x) - t_1);
} else {
tmp = t_2 + ((z + y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if (x + y) <= -2e-123: tmp = t_2 + ((z + x) - t_1) else: tmp = t_2 + ((z + y) - t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -2e-123) tmp = Float64(t_2 + Float64(Float64(z + x) - t_1)); else tmp = Float64(t_2 + Float64(Float64(z + y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); t_2 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -2e-123) tmp = t_2 + ((z + x) - t_1); else tmp = t_2 + ((z + y) - 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]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -2e-123], N[(t$95$2 + N[(N[(z + x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(z + y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -2 \cdot 10^{-123}:\\
\;\;\;\;t\_2 + \left(\left(z + x\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(z + y\right) - t\_1\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -2.0000000000000001e-123Initial program 99.9%
Taylor expanded in y around 0 70.7%
+-commutative70.7%
Simplified70.7%
if -2.0000000000000001e-123 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 86.0%
+-commutative86.0%
Simplified86.0%
Final simplification79.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.4e+216) (not (<= z 7.8e+158))) (+ (* z (- 1.0 (log t))) (* a b)) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.4e+216) || !(z <= 7.8e+158)) {
tmp = (z * (1.0 - log(t))) + (a * b);
} else {
tmp = (x + y) + (b * (a - 0.5));
}
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.4d+216)) .or. (.not. (z <= 7.8d+158))) then
tmp = (z * (1.0d0 - log(t))) + (a * b)
else
tmp = (x + y) + (b * (a - 0.5d0))
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.4e+216) || !(z <= 7.8e+158)) {
tmp = (z * (1.0 - Math.log(t))) + (a * b);
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.4e+216) or not (z <= 7.8e+158): tmp = (z * (1.0 - math.log(t))) + (a * b) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.4e+216) || !(z <= 7.8e+158)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(a * b)); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.4e+216) || ~((z <= 7.8e+158))) tmp = (z * (1.0 - log(t))) + (a * b); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.4e+216], N[Not[LessEqual[z, 7.8e+158]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+216} \lor \neg \left(z \leq 7.8 \cdot 10^{+158}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -2.3999999999999999e216 or 7.8e158 < z Initial program 99.6%
+-commutative99.6%
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 a around inf 82.9%
*-commutative82.9%
Simplified82.9%
if -2.3999999999999999e216 < z < 7.8e158Initial program 99.9%
add-cube-cbrt99.7%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.7%
Final simplification89.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.2e+248) (not (<= z 1.05e+168))) (+ (* z (- 1.0 (log t))) x) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.2e+248) || !(z <= 1.05e+168)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
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.2d+248)) .or. (.not. (z <= 1.05d+168))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = (x + y) + (b * (a - 0.5d0))
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.2e+248) || !(z <= 1.05e+168)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.2e+248) or not (z <= 1.05e+168): tmp = (z * (1.0 - math.log(t))) + x else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.2e+248) || !(z <= 1.05e+168)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.2e+248) || ~((z <= 1.05e+168))) tmp = (z * (1.0 - log(t))) + x; else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.2e+248], N[Not[LessEqual[z, 1.05e+168]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+248} \lor \neg \left(z \leq 1.05 \cdot 10^{+168}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -2.1999999999999999e248 or 1.05000000000000001e168 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 74.5%
if -2.1999999999999999e248 < z < 1.05000000000000001e168Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 89.9%
Final simplification87.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -1.8e+218)
(+ t_1 (* -0.5 b))
(if (<= z 9.5e+167) (+ (+ x y) (* b (- a 0.5))) (+ t_1 x)))))
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.8e+218) {
tmp = t_1 + (-0.5 * b);
} else if (z <= 9.5e+167) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + x;
}
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.8d+218)) then
tmp = t_1 + ((-0.5d0) * b)
else if (z <= 9.5d+167) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = t_1 + x
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.8e+218) {
tmp = t_1 + (-0.5 * b);
} else if (z <= 9.5e+167) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -1.8e+218: tmp = t_1 + (-0.5 * b) elif z <= 9.5e+167: tmp = (x + y) + (b * (a - 0.5)) else: tmp = t_1 + x 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.8e+218) tmp = Float64(t_1 + Float64(-0.5 * b)); elseif (z <= 9.5e+167) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(t_1 + x); 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.8e+218) tmp = t_1 + (-0.5 * b); elseif (z <= 9.5e+167) tmp = (x + y) + (b * (a - 0.5)); else tmp = t_1 + x; 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.8e+218], N[(t$95$1 + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+167], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+218}:\\
\;\;\;\;t\_1 + -0.5 \cdot b\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+167}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if z < -1.79999999999999995e218Initial program 99.6%
+-commutative99.6%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around inf 93.4%
Taylor expanded in a around 0 72.8%
if -1.79999999999999995e218 < z < 9.5000000000000006e167Initial program 99.9%
add-cube-cbrt99.7%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.7%
if 9.5000000000000006e167 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
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 76.5%
Final simplification87.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -1.65e+217)
(+ t_1 y)
(if (<= z 2.3e+165) (+ (+ x y) (* b (- a 0.5))) (+ t_1 x)))))
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.65e+217) {
tmp = t_1 + y;
} else if (z <= 2.3e+165) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + x;
}
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.65d+217)) then
tmp = t_1 + y
else if (z <= 2.3d+165) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = t_1 + x
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.65e+217) {
tmp = t_1 + y;
} else if (z <= 2.3e+165) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -1.65e+217: tmp = t_1 + y elif z <= 2.3e+165: tmp = (x + y) + (b * (a - 0.5)) else: tmp = t_1 + x 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.65e+217) tmp = Float64(t_1 + y); elseif (z <= 2.3e+165) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(t_1 + x); 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.65e+217) tmp = t_1 + y; elseif (z <= 2.3e+165) tmp = (x + y) + (b * (a - 0.5)); else tmp = t_1 + x; 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.65e+217], N[(t$95$1 + y), $MachinePrecision], If[LessEqual[z, 2.3e+165], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+217}:\\
\;\;\;\;t\_1 + y\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+165}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if z < -1.65e217Initial program 99.6%
+-commutative99.6%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 66.0%
if -1.65e217 < z < 2.30000000000000016e165Initial program 99.9%
add-cube-cbrt99.7%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.7%
if 2.30000000000000016e165 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
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 76.5%
Final simplification86.9%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (+ (* -0.5 b) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + ((-0.5 * b) + (a * 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 = ((z + (x + y)) - (z * log(t))) + (((-0.5d0) * b) + (a * b))
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))) + ((-0.5 * b) + (a * b));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + ((-0.5 * b) + (a * b))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(Float64(-0.5 * b) + Float64(a * b))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + ((-0.5 * b) + (a * b)); 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[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + \left(-0.5 \cdot b + a \cdot b\right)
\end{array}
Initial program 99.9%
sub-neg99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-lft-in99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5e+246) (not (<= z 1.55e+168))) (* z (- 1.0 (log t))) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5e+246) || !(z <= 1.55e+168)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
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 <= (-5d+246)) .or. (.not. (z <= 1.55d+168))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (x + y) + (b * (a - 0.5d0))
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 <= -5e+246) || !(z <= 1.55e+168)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5e+246) or not (z <= 1.55e+168): tmp = z * (1.0 - math.log(t)) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5e+246) || !(z <= 1.55e+168)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5e+246) || ~((z <= 1.55e+168))) tmp = z * (1.0 - log(t)); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5e+246], N[Not[LessEqual[z, 1.55e+168]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+246} \lor \neg \left(z \leq 1.55 \cdot 10^{+168}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -4.99999999999999976e246 or 1.54999999999999998e168 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 74.5%
Taylor expanded in z around inf 70.3%
if -4.99999999999999976e246 < z < 1.54999999999999998e168Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 89.9%
Final simplification86.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.6e+247) (- z (* z (log t))) (if (<= z 1.06e+162) (+ (+ x y) (* b (- a 0.5))) (* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.6e+247) {
tmp = z - (z * log(t));
} else if (z <= 1.06e+162) {
tmp = (x + y) + (b * (a - 0.5));
} 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 <= (-1.6d+247)) then
tmp = z - (z * log(t))
else if (z <= 1.06d+162) then
tmp = (x + y) + (b * (a - 0.5d0))
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 <= -1.6e+247) {
tmp = z - (z * Math.log(t));
} else if (z <= 1.06e+162) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z * (1.0 - Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.6e+247: tmp = z - (z * math.log(t)) elif z <= 1.06e+162: tmp = (x + y) + (b * (a - 0.5)) else: tmp = z * (1.0 - math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.6e+247) tmp = Float64(z - Float64(z * log(t))); elseif (z <= 1.06e+162) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); 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 <= -1.6e+247) tmp = z - (z * log(t)); elseif (z <= 1.06e+162) tmp = (x + y) + (b * (a - 0.5)); else tmp = z * (1.0 - log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.6e+247], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.06e+162], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+247}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{+162}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -1.60000000000000011e247Initial program 99.6%
sub-neg99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-lft-in99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 97.0%
Taylor expanded in b around 0 70.6%
if -1.60000000000000011e247 < z < 1.05999999999999991e162Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 89.9%
if 1.05999999999999991e162 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
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 76.5%
Taylor expanded in z around inf 70.2%
Final simplification86.4%
(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
(let* ((t_1 (* b (- a 0.5))))
(if (<= b -1.9e+78)
t_1
(if (<= b 1.42e-28) (+ x y) (if (<= b 3.3e+218) (+ y (* a b)) 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 (b <= -1.9e+78) {
tmp = t_1;
} else if (b <= 1.42e-28) {
tmp = x + y;
} else if (b <= 3.3e+218) {
tmp = y + (a * b);
} else {
tmp = 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 (b <= (-1.9d+78)) then
tmp = t_1
else if (b <= 1.42d-28) then
tmp = x + y
else if (b <= 3.3d+218) then
tmp = y + (a * b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (b <= -1.9e+78) {
tmp = t_1;
} else if (b <= 1.42e-28) {
tmp = x + y;
} else if (b <= 3.3e+218) {
tmp = y + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if b <= -1.9e+78: tmp = t_1 elif b <= 1.42e-28: tmp = x + y elif b <= 3.3e+218: tmp = y + (a * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (b <= -1.9e+78) tmp = t_1; elseif (b <= 1.42e-28) tmp = Float64(x + y); elseif (b <= 3.3e+218) tmp = Float64(y + Float64(a * b)); else tmp = 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 (b <= -1.9e+78) tmp = t_1; elseif (b <= 1.42e-28) tmp = x + y; elseif (b <= 3.3e+218) tmp = y + (a * b); else tmp = 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[b, -1.9e+78], t$95$1, If[LessEqual[b, 1.42e-28], N[(x + y), $MachinePrecision], If[LessEqual[b, 3.3e+218], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -1.9 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.42 \cdot 10^{-28}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{+218}:\\
\;\;\;\;y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.9e78 or 3.29999999999999998e218 < b Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 96.7%
Taylor expanded in b around inf 83.7%
if -1.9e78 < b < 1.42000000000000001e-28Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 72.6%
Taylor expanded in b around 0 65.5%
+-commutative65.5%
Simplified65.5%
if 1.42000000000000001e-28 < b < 3.29999999999999998e218Initial program 99.8%
add-cube-cbrt99.5%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 75.3%
Taylor expanded in a around inf 68.4%
Taylor expanded in x around 0 56.1%
Final simplification67.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9.5e+48) (not (<= a 0.5))) (+ (+ x y) (* a b)) (+ (+ x y) (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9.5e+48) || !(a <= 0.5)) {
tmp = (x + y) + (a * b);
} else {
tmp = (x + y) + (-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 ((a <= (-9.5d+48)) .or. (.not. (a <= 0.5d0))) then
tmp = (x + y) + (a * b)
else
tmp = (x + y) + ((-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 ((a <= -9.5e+48) || !(a <= 0.5)) {
tmp = (x + y) + (a * b);
} else {
tmp = (x + y) + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9.5e+48) or not (a <= 0.5): tmp = (x + y) + (a * b) else: tmp = (x + y) + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -9.5e+48) || !(a <= 0.5)) tmp = Float64(Float64(x + y) + Float64(a * b)); else tmp = Float64(Float64(x + y) + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -9.5e+48) || ~((a <= 0.5))) tmp = (x + y) + (a * b); else tmp = (x + y) + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -9.5e+48], N[Not[LessEqual[a, 0.5]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+48} \lor \neg \left(a \leq 0.5\right):\\
\;\;\;\;\left(x + y\right) + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + -0.5 \cdot b\\
\end{array}
\end{array}
if a < -9.4999999999999997e48 or 0.5 < a Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 87.7%
Taylor expanded in a around inf 87.7%
if -9.4999999999999997e48 < a < 0.5Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 71.7%
Taylor expanded in a around 0 71.2%
Final simplification78.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.5e+78) (not (<= b 1.6e+14))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.5e+78) || !(b <= 1.6e+14)) {
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 <= (-6.5d+78)) .or. (.not. (b <= 1.6d+14))) 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 <= -6.5e+78) || !(b <= 1.6e+14)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.5e+78) or not (b <= 1.6e+14): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.5e+78) || !(b <= 1.6e+14)) 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 <= -6.5e+78) || ~((b <= 1.6e+14))) 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, -6.5e+78], N[Not[LessEqual[b, 1.6e+14]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{+78} \lor \neg \left(b \leq 1.6 \cdot 10^{+14}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -6.50000000000000036e78 or 1.6e14 < b Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.2%
Taylor expanded in b around inf 70.4%
if -6.50000000000000036e78 < b < 1.6e14Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 71.5%
Taylor expanded in b around 0 63.1%
+-commutative63.1%
Simplified63.1%
Final simplification66.1%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -200000000.0) (+ x (* a b)) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -200000000.0) {
tmp = x + (a * b);
} else {
tmp = y + (b * (a - 0.5));
}
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 + y) <= (-200000000.0d0)) then
tmp = x + (a * b)
else
tmp = y + (b * (a - 0.5d0))
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 + y) <= -200000000.0) {
tmp = x + (a * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -200000000.0: tmp = x + (a * b) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -200000000.0) tmp = Float64(x + Float64(a * b)); else tmp = Float64(y + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -200000000.0) tmp = x + (a * b); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -200000000.0], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -200000000:\\
\;\;\;\;x + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -2e8Initial program 100.0%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 87.7%
Taylor expanded in a around inf 82.2%
Taylor expanded in y around 0 48.6%
+-commutative48.6%
Simplified48.6%
if -2e8 < (+.f64 x y) Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 61.0%
Final simplification56.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.8e+78) (not (<= b 1.55e+14))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.8e+78) || !(b <= 1.55e+14)) {
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 ((b <= (-3.8d+78)) .or. (.not. (b <= 1.55d+14))) 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 ((b <= -3.8e+78) || !(b <= 1.55e+14)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.8e+78) or not (b <= 1.55e+14): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.8e+78) || !(b <= 1.55e+14)) 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 ((b <= -3.8e+78) || ~((b <= 1.55e+14))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.8e+78], N[Not[LessEqual[b, 1.55e+14]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+78} \lor \neg \left(b \leq 1.55 \cdot 10^{+14}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -3.7999999999999999e78 or 1.55e14 < b Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.2%
Taylor expanded in a around inf 49.2%
if -3.7999999999999999e78 < b < 1.55e14Initial program 99.8%
add-cube-cbrt99.4%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in z around 0 71.5%
Taylor expanded in b around 0 63.1%
+-commutative63.1%
Simplified63.1%
Final simplification57.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.75e+53) x (if (<= x 5.4e-288) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.75e+53) {
tmp = x;
} else if (x <= 5.4e-288) {
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 (x <= (-1.75d+53)) then
tmp = x
else if (x <= 5.4d-288) 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 (x <= -1.75e+53) {
tmp = x;
} else if (x <= 5.4e-288) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.75e+53: tmp = x elif x <= 5.4e-288: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.75e+53) tmp = x; elseif (x <= 5.4e-288) 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 (x <= -1.75e+53) tmp = x; elseif (x <= 5.4e-288) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.75e+53], x, If[LessEqual[x, 5.4e-288], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-288}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.75000000000000009e53Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
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 62.9%
Taylor expanded in z around 0 51.2%
if -1.75000000000000009e53 < x < 5.4000000000000002e-288Initial program 99.8%
add-cube-cbrt99.5%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 75.8%
Taylor expanded in a around inf 31.2%
if 5.4000000000000002e-288 < x Initial program 99.9%
add-cube-cbrt99.5%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 78.8%
Taylor expanded in y around inf 30.1%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (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 = (x + y) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (x + y) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
add-cube-cbrt99.5%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in z around 0 79.1%
Final simplification79.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4.7e+29) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4.7e+29) {
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 (y <= 4.7d+29) 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 (y <= 4.7e+29) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 4.7e+29: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 4.7e+29) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 4.7e+29) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4.7e+29], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.7 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 4.7000000000000002e29Initial 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 47.3%
Taylor expanded in z around 0 24.8%
if 4.7000000000000002e29 < y Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 84.1%
Taylor expanded in y around inf 50.2%
(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.7%
Taylor expanded in z around 0 19.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 2024163
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))