
(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 17 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 -500.0) (not (<= t_1 5.0)))
(+ (+ 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 <= -500.0) || !(t_1 <= 5.0)) {
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 <= (-500.0d0)) .or. (.not. (t_1 <= 5.0d0))) 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 <= -500.0) || !(t_1 <= 5.0)) {
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 <= -500.0) or not (t_1 <= 5.0): 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 <= -500.0) || !(t_1 <= 5.0)) 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 <= -500.0) || ~((t_1 <= 5.0))) 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, -500.0], N[Not[LessEqual[t$95$1, 5.0]], $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 -500 \lor \neg \left(t\_1 \leq 5\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) < -500 or 5 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around -inf 83.4%
associate-*r*83.4%
neg-mul-183.4%
mul-1-neg83.4%
neg-mul-183.4%
sub-neg83.4%
Simplified83.4%
Taylor expanded in z around 0 88.1%
+-commutative88.1%
Simplified88.1%
if -500 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
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 94.5%
Final simplification90.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (log t))) (t_2 (+ z (* b (- a 0.5))))) (if (<= (+ x y) -1e-66) (- (+ x t_2) t_1) (- (+ y t_2) 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 = z + (b * (a - 0.5));
double tmp;
if ((x + y) <= -1e-66) {
tmp = (x + t_2) - t_1;
} else {
tmp = (y + t_2) - 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 = z + (b * (a - 0.5d0))
if ((x + y) <= (-1d-66)) then
tmp = (x + t_2) - t_1
else
tmp = (y + t_2) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * Math.log(t);
double t_2 = z + (b * (a - 0.5));
double tmp;
if ((x + y) <= -1e-66) {
tmp = (x + t_2) - t_1;
} else {
tmp = (y + t_2) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = z + (b * (a - 0.5)) tmp = 0 if (x + y) <= -1e-66: tmp = (x + t_2) - t_1 else: tmp = (y + t_2) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(z + Float64(b * Float64(a - 0.5))) tmp = 0.0 if (Float64(x + y) <= -1e-66) tmp = Float64(Float64(x + t_2) - t_1); else tmp = Float64(Float64(y + t_2) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); t_2 = z + (b * (a - 0.5)); tmp = 0.0; if ((x + y) <= -1e-66) tmp = (x + t_2) - t_1; else tmp = (y + t_2) - 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[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -1e-66], N[(N[(x + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := z + b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{-66}:\\
\;\;\;\;\left(x + t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + t\_2\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -9.9999999999999998e-67Initial program 99.9%
Taylor expanded in y around 0 72.1%
if -9.9999999999999998e-67 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 82.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 5e+49) (- (+ x (+ z t_1)) (* z (log t))) (+ (+ x 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+49) {
tmp = (x + (z + t_1)) - (z * log(t));
} else {
tmp = (x + 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+49) then
tmp = (x + (z + t_1)) - (z * log(t))
else
tmp = (x + 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+49) {
tmp = (x + (z + t_1)) - (z * Math.log(t));
} else {
tmp = (x + 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+49: tmp = (x + (z + t_1)) - (z * math.log(t)) else: tmp = (x + 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+49) tmp = Float64(Float64(x + Float64(z + t_1)) - Float64(z * log(t))); else tmp = Float64(Float64(x + 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+49) tmp = (x + (z + t_1)) - (z * log(t)); else tmp = (x + 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+49], N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + 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^{+49}:\\
\;\;\;\;\left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 5.0000000000000004e49Initial program 99.8%
Taylor expanded in y around 0 82.8%
if 5.0000000000000004e49 < (+.f64 x y) Initial program 99.9%
Taylor expanded in z around -inf 69.1%
associate-*r*69.1%
neg-mul-169.1%
mul-1-neg69.1%
neg-mul-169.1%
sub-neg69.1%
Simplified69.1%
Taylor expanded in z around 0 89.0%
+-commutative89.0%
Simplified89.0%
Final simplification84.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.8e+153) (not (<= z 8.5e+92))) (+ (* 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.8e+153) || !(z <= 8.5e+92)) {
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.8d+153)) .or. (.not. (z <= 8.5d+92))) 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.8e+153) || !(z <= 8.5e+92)) {
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.8e+153) or not (z <= 8.5e+92): 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.8e+153) || !(z <= 8.5e+92)) 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.8e+153) || ~((z <= 8.5e+92))) 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.8e+153], N[Not[LessEqual[z, 8.5e+92]], $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.8 \cdot 10^{+153} \lor \neg \left(z \leq 8.5 \cdot 10^{+92}\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.79999999999999985e153 or 8.5000000000000001e92 < 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 a around inf 76.1%
*-commutative76.1%
Simplified76.1%
if -2.79999999999999985e153 < z < 8.5000000000000001e92Initial program 99.9%
Taylor expanded in z around -inf 74.1%
associate-*r*74.1%
neg-mul-174.1%
mul-1-neg74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
Taylor expanded in z around 0 92.3%
+-commutative92.3%
Simplified92.3%
Final simplification87.5%
(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+93) (+ (+ x y) (* b (- a 0.5))) (+ (* z (- 1.0 (log t))) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.1e+93) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z * (1.0 - log(t))) + 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) :: tmp
if (z <= 2.1d+93) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = (z * (1.0d0 - log(t))) + x
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+93) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z * (1.0 - Math.log(t))) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 2.1e+93: tmp = (x + y) + (b * (a - 0.5)) else: tmp = (z * (1.0 - math.log(t))) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.1e+93) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 2.1e+93) tmp = (x + y) + (b * (a - 0.5)); else tmp = (z * (1.0 - log(t))) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.1e+93], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.1 \cdot 10^{+93}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\end{array}
\end{array}
if z < 2.0999999999999998e93Initial program 99.9%
Taylor expanded in z around -inf 77.3%
associate-*r*77.3%
neg-mul-177.3%
mul-1-neg77.3%
neg-mul-177.3%
sub-neg77.3%
Simplified77.3%
Taylor expanded in z around 0 86.9%
+-commutative86.9%
Simplified86.9%
if 2.0999999999999998e93 < 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 71.3%
Final simplification83.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z 2.1e+168) (+ (+ 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 <= 2.1e+168) {
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 <= 2.1d+168) 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 <= 2.1e+168) {
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 <= 2.1e+168: 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 <= 2.1e+168) 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 <= 2.1e+168) 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, 2.1e+168], 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 2.1 \cdot 10^{+168}:\\
\;\;\;\;\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 < 2.10000000000000003e168Initial program 99.9%
Taylor expanded in z around -inf 78.6%
associate-*r*78.6%
neg-mul-178.6%
mul-1-neg78.6%
neg-mul-178.6%
sub-neg78.6%
Simplified78.6%
Taylor expanded in z around 0 85.1%
+-commutative85.1%
Simplified85.1%
if 2.10000000000000003e168 < 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 77.8%
Taylor expanded in z around inf 69.7%
Final simplification83.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -2e+64) (not (<= t_1 2e+149)))
(+ y t_1)
(+ (+ x y) (* -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 <= -2e+64) || !(t_1 <= 2e+149)) {
tmp = y + t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-2d+64)) .or. (.not. (t_1 <= 2d+149))) then
tmp = y + t_1
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 t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+64) || !(t_1 <= 2e+149)) {
tmp = y + t_1;
} else {
tmp = (x + y) + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+64) or not (t_1 <= 2e+149): tmp = y + t_1 else: tmp = (x + y) + (-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 <= -2e+64) || !(t_1 <= 2e+149)) tmp = Float64(y + t_1); else tmp = Float64(Float64(x + y) + 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 <= -2e+64) || ~((t_1 <= 2e+149))) tmp = y + t_1; else tmp = (x + y) + (-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[Or[LessEqual[t$95$1, -2e+64], N[Not[LessEqual[t$95$1, 2e+149]], $MachinePrecision]], N[(y + t$95$1), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+64} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+149}\right):\\
\;\;\;\;y + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + -0.5 \cdot b\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.00000000000000004e64 or 2.0000000000000001e149 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in z around -inf 83.3%
associate-*r*83.3%
neg-mul-183.3%
mul-1-neg83.3%
neg-mul-183.3%
sub-neg83.3%
Simplified83.3%
Taylor expanded in y around inf 85.2%
if -2.00000000000000004e64 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000001e149Initial program 99.8%
Taylor expanded in z around -inf 80.3%
associate-*r*80.3%
neg-mul-180.3%
mul-1-neg80.3%
neg-mul-180.3%
sub-neg80.3%
Simplified80.3%
Taylor expanded in z around 0 65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in a around 0 60.0%
Final simplification70.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (- a 0.5) -50000.0) (not (<= (- a 0.5) -0.4))) (+ (+ 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 - 0.5) <= -50000.0) || !((a - 0.5) <= -0.4)) {
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 - 0.5d0) <= (-50000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) 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 - 0.5) <= -50000.0) || !((a - 0.5) <= -0.4)) {
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 - 0.5) <= -50000.0) or not ((a - 0.5) <= -0.4): 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 ((Float64(a - 0.5) <= -50000.0) || !(Float64(a - 0.5) <= -0.4)) 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 - 0.5) <= -50000.0) || ~(((a - 0.5) <= -0.4))) 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[N[(a - 0.5), $MachinePrecision], -50000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $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 - 0.5 \leq -50000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;\left(x + y\right) + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + -0.5 \cdot b\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -5e4 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
Taylor expanded in z around -inf 82.6%
associate-*r*82.6%
neg-mul-182.6%
mul-1-neg82.6%
neg-mul-182.6%
sub-neg82.6%
Simplified82.6%
Taylor expanded in z around 0 83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in a around inf 82.5%
if -5e4 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002Initial program 99.8%
Taylor expanded in z around -inf 80.5%
associate-*r*80.5%
neg-mul-180.5%
mul-1-neg80.5%
neg-mul-180.5%
sub-neg80.5%
Simplified80.5%
Taylor expanded in z around 0 70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in a around 0 69.5%
Final simplification75.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -24000000000.0) (* a b) (if (<= a -1.4e-37) x (if (<= a 0.5) (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -24000000000.0) {
tmp = a * b;
} else if (a <= -1.4e-37) {
tmp = x;
} else if (a <= 0.5) {
tmp = -0.5 * b;
} else {
tmp = a * 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 <= (-24000000000.0d0)) then
tmp = a * b
else if (a <= (-1.4d-37)) then
tmp = x
else if (a <= 0.5d0) then
tmp = (-0.5d0) * b
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -24000000000.0) {
tmp = a * b;
} else if (a <= -1.4e-37) {
tmp = x;
} else if (a <= 0.5) {
tmp = -0.5 * b;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -24000000000.0: tmp = a * b elif a <= -1.4e-37: tmp = x elif a <= 0.5: tmp = -0.5 * b else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -24000000000.0) tmp = Float64(a * b); elseif (a <= -1.4e-37) tmp = x; elseif (a <= 0.5) tmp = Float64(-0.5 * b); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -24000000000.0) tmp = a * b; elseif (a <= -1.4e-37) tmp = x; elseif (a <= 0.5) tmp = -0.5 * b; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -24000000000.0], N[(a * b), $MachinePrecision], If[LessEqual[a, -1.4e-37], x, If[LessEqual[a, 0.5], N[(-0.5 * b), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -24000000000:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-37}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 0.5:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -2.4e10 or 0.5 < a 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 80.4%
sub-neg80.4%
metadata-eval80.4%
+-commutative80.4%
associate-/l*80.4%
Simplified80.4%
Taylor expanded in b around inf 49.8%
associate-*r*47.4%
*-commutative47.4%
associate-*r/47.4%
metadata-eval47.4%
div-sub47.4%
sub-neg47.4%
metadata-eval47.4%
+-commutative47.4%
Simplified47.4%
Taylor expanded in a around inf 54.1%
*-commutative54.1%
Simplified54.1%
if -2.4e10 < a < -1.4000000000000001e-37Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 59.0%
Taylor expanded in z around 0 34.7%
if -1.4000000000000001e-37 < a < 0.5Initial 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 x around inf 76.8%
sub-neg76.8%
metadata-eval76.8%
+-commutative76.8%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in b around inf 28.1%
associate-*r*19.1%
*-commutative19.1%
associate-*r/19.1%
metadata-eval19.1%
div-sub19.1%
sub-neg19.1%
metadata-eval19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in a around 0 27.2%
*-commutative27.2%
Simplified27.2%
Final simplification40.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -0.09) (not (<= b 1.32e-5))) (* b (- a 0.5)) (* x (+ 1.0 (/ y x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -0.09) || !(b <= 1.32e-5)) {
tmp = b * (a - 0.5);
} else {
tmp = x * (1.0 + (y / 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) :: tmp
if ((b <= (-0.09d0)) .or. (.not. (b <= 1.32d-5))) then
tmp = b * (a - 0.5d0)
else
tmp = x * (1.0d0 + (y / x))
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 <= -0.09) || !(b <= 1.32e-5)) {
tmp = b * (a - 0.5);
} else {
tmp = x * (1.0 + (y / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -0.09) or not (b <= 1.32e-5): tmp = b * (a - 0.5) else: tmp = x * (1.0 + (y / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -0.09) || !(b <= 1.32e-5)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x * Float64(1.0 + Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -0.09) || ~((b <= 1.32e-5))) tmp = b * (a - 0.5); else tmp = x * (1.0 + (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -0.09], N[Not[LessEqual[b, 1.32e-5]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.09 \lor \neg \left(b \leq 1.32 \cdot 10^{-5}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{y}{x}\right)\\
\end{array}
\end{array}
if b < -0.089999999999999997 or 1.32000000000000007e-5 < b Initial 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 78.3%
sub-neg78.3%
metadata-eval78.3%
+-commutative78.3%
associate-/l*78.3%
Simplified78.3%
Taylor expanded in b around inf 68.6%
associate-*r*58.3%
*-commutative58.3%
associate-*r/58.3%
metadata-eval58.3%
div-sub58.3%
sub-neg58.3%
metadata-eval58.3%
+-commutative58.3%
Simplified58.3%
Taylor expanded in x around 0 71.0%
if -0.089999999999999997 < b < 1.32000000000000007e-5Initial 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 x around inf 79.4%
sub-neg79.4%
metadata-eval79.4%
+-commutative79.4%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in y around inf 48.7%
Final simplification59.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.5e+144) (* x (+ 1.0 (/ y x))) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.5e+144) {
tmp = x * (1.0 + (y / x));
} 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 <= (-5.5d+144)) then
tmp = x * (1.0d0 + (y / x))
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 <= -5.5e+144) {
tmp = x * (1.0 + (y / x));
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.5e+144: tmp = x * (1.0 + (y / x)) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.5e+144) tmp = Float64(x * Float64(1.0 + Float64(y / x))); 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 <= -5.5e+144) tmp = x * (1.0 + (y / x)); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.5e+144], N[(x * N[(1.0 + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+144}:\\
\;\;\;\;x \cdot \left(1 + \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if x < -5.50000000000000022e144Initial 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 99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 64.0%
if -5.50000000000000022e144 < x Initial program 99.9%
Taylor expanded in z around -inf 84.4%
associate-*r*84.4%
neg-mul-184.4%
mul-1-neg84.4%
neg-mul-184.4%
sub-neg84.4%
Simplified84.4%
Taylor expanded in y around inf 61.9%
Final simplification62.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6e+144) x (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6e+144) {
tmp = x;
} else {
tmp = 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 <= (-6d+144)) then
tmp = x
else
tmp = 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 <= -6e+144) {
tmp = x;
} else {
tmp = b * (a - 0.5);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6e+144: tmp = x else: tmp = b * (a - 0.5) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6e+144) tmp = x; else tmp = 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 <= -6e+144) tmp = x; else tmp = b * (a - 0.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6e+144], x, N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+144}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if x < -5.9999999999999998e144Initial 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 57.5%
Taylor expanded in z around 0 51.4%
if -5.9999999999999998e144 < x 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 76.0%
sub-neg76.0%
metadata-eval76.0%
+-commutative76.0%
associate-/l*75.9%
Simplified75.9%
Taylor expanded in b around inf 39.4%
associate-*r*34.7%
*-commutative34.7%
associate-*r/34.7%
metadata-eval34.7%
div-sub34.7%
sub-neg34.7%
metadata-eval34.7%
+-commutative34.7%
Simplified34.7%
Taylor expanded in x around 0 42.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%
Taylor expanded in z around -inf 81.6%
associate-*r*81.6%
neg-mul-181.6%
mul-1-neg81.6%
neg-mul-181.6%
sub-neg81.6%
Simplified81.6%
Taylor expanded in z around 0 77.1%
+-commutative77.1%
Simplified77.1%
Final simplification77.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4.8e+51) x (* -0.5 b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.8e+51) {
tmp = x;
} else {
tmp = -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 (x <= (-4.8d+51)) then
tmp = x
else
tmp = (-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 (x <= -4.8e+51) {
tmp = x;
} else {
tmp = -0.5 * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.8e+51: tmp = x else: tmp = -0.5 * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.8e+51) tmp = x; else tmp = Float64(-0.5 * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -4.8e+51) tmp = x; else tmp = -0.5 * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.8e+51], x, N[(-0.5 * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+51}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b\\
\end{array}
\end{array}
if x < -4.7999999999999997e51Initial 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-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 45.7%
Taylor expanded in z around 0 35.7%
if -4.7999999999999997e51 < x 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 73.9%
sub-neg73.9%
metadata-eval73.9%
+-commutative73.9%
associate-/l*73.9%
Simplified73.9%
Taylor expanded in b around inf 37.4%
associate-*r*34.1%
*-commutative34.1%
associate-*r/34.1%
metadata-eval34.1%
div-sub34.1%
sub-neg34.1%
metadata-eval34.1%
+-commutative34.1%
Simplified34.1%
Taylor expanded in a around 0 15.2%
*-commutative15.2%
Simplified15.2%
Final simplification19.1%
(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 40.8%
Taylor expanded in z around 0 19.5%
(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 2024167
(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)))