
(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 16 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 (+ (fma b a (* -0.5 b)) (- (+ (+ y x) z) (* (log t) z))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(b, a, (-0.5 * b)) + (((y + x) + z) - (log(t) * z));
}
function code(x, y, z, t, a, b) return Float64(fma(b, a, Float64(-0.5 * b)) + Float64(Float64(Float64(y + x) + z) - Float64(log(t) * z))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * a + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + x), $MachinePrecision] + z), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b, a, -0.5 \cdot b\right) + \left(\left(\left(y + x\right) + z\right) - \log t \cdot z\right)
\end{array}
Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b))
(t_2 (- 1.0 (log t)))
(t_3 (fma t_2 z (fma (- a 0.5) b y))))
(if (<= t_1 -2e+93) t_3 (if (<= t_1 2e+72) (+ (fma t_2 z x) y) t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = 1.0 - log(t);
double t_3 = fma(t_2, z, fma((a - 0.5), b, y));
double tmp;
if (t_1 <= -2e+93) {
tmp = t_3;
} else if (t_1 <= 2e+72) {
tmp = fma(t_2, z, x) + y;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = Float64(1.0 - log(t)) t_3 = fma(t_2, z, fma(Float64(a - 0.5), b, y)) tmp = 0.0 if (t_1 <= -2e+93) tmp = t_3; elseif (t_1 <= 2e+72) tmp = Float64(fma(t_2, z, x) + y); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * z + N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+93], t$95$3, If[LessEqual[t$95$1, 2e+72], N[(N[(t$95$2 * z + x), $MachinePrecision] + y), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := 1 - \log t\\
t_3 := \mathsf{fma}\left(t\_2, z, \mathsf{fma}\left(a - 0.5, b, y\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+93}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, z, x\right) + y\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.00000000000000009e93 or 1.99999999999999989e72 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
log-recN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites94.1%
if -2.00000000000000009e93 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999989e72Initial program 99.8%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6497.9
Applied rewrites97.9%
Applied rewrites97.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)))
(if (<= t_1 -1e+95)
(+ (fma (- a 0.5) b y) x)
(if (<= t_1 5e+79)
(+ (fma (- 1.0 (log t)) z x) y)
(fma b a (fma -0.5 b (+ y x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -1e+95) {
tmp = fma((a - 0.5), b, y) + x;
} else if (t_1 <= 5e+79) {
tmp = fma((1.0 - log(t)), z, x) + y;
} else {
tmp = fma(b, a, fma(-0.5, b, (y + x)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -1e+95) tmp = Float64(fma(Float64(a - 0.5), b, y) + x); elseif (t_1 <= 5e+79) tmp = Float64(fma(Float64(1.0 - log(t)), z, x) + y); else tmp = fma(b, a, fma(-0.5, b, Float64(y + x))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+95], N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+79], N[(N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision] + y), $MachinePrecision], N[(b * a + N[(-0.5 * b + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, y\right) + x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, x\right) + y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(-0.5, b, y + x\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.00000000000000002e95Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6488.3
Applied rewrites88.3%
if -1.00000000000000002e95 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5e79Initial program 99.8%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6497.4
Applied rewrites97.4%
Applied rewrites97.4%
if 5e79 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6485.5
Applied rewrites85.5%
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6485.5
Applied rewrites85.5%
Final simplification92.5%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ y x) -5e-78) (fma (- a 0.5) b (fma (- z) (log t) (+ z x))) (fma (- 1.0 (log t)) z (fma (- a 0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y + x) <= -5e-78) {
tmp = fma((a - 0.5), b, fma(-z, log(t), (z + x)));
} else {
tmp = fma((1.0 - log(t)), z, fma((a - 0.5), b, y));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y + x) <= -5e-78) tmp = fma(Float64(a - 0.5), b, fma(Float64(-z), log(t), Float64(z + x))); else tmp = fma(Float64(1.0 - log(t)), z, fma(Float64(a - 0.5), b, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], -5e-78], N[(N[(a - 0.5), $MachinePrecision] * b + N[((-z) * N[Log[t], $MachinePrecision] + N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -5 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, \mathsf{fma}\left(-z, \log t, z + x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(a - 0.5, b, y\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -4.9999999999999996e-78Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
+-commutativeN/A
lower-+.f6468.9
Applied rewrites68.9%
if -4.9999999999999996e-78 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
log-recN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites79.3%
Final simplification74.8%
(FPCore (x y z t a b) :precision binary64 (+ (* (- a 0.5) b) (- (+ (+ y x) z) (* (log t) z))))
double code(double x, double y, double z, double t, double a, double b) {
return ((a - 0.5) * b) + (((y + x) + z) - (log(t) * z));
}
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 = ((a - 0.5d0) * b) + (((y + x) + z) - (log(t) * z))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((a - 0.5) * b) + (((y + x) + z) - (Math.log(t) * z));
}
def code(x, y, z, t, a, b): return ((a - 0.5) * b) + (((y + x) + z) - (math.log(t) * z))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(a - 0.5) * b) + Float64(Float64(Float64(y + x) + z) - Float64(log(t) * z))) end
function tmp = code(x, y, z, t, a, b) tmp = ((a - 0.5) * b) + (((y + x) + z) - (log(t) * z)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision] + N[(N[(N[(y + x), $MachinePrecision] + z), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a - 0.5\right) \cdot b + \left(\left(\left(y + x\right) + z\right) - \log t \cdot z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (fma (- a 0.5) b (fma (- z) (log t) (+ (+ y x) z))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a - 0.5), b, fma(-z, log(t), ((y + x) + z)));
}
function code(x, y, z, t, a, b) return fma(Float64(a - 0.5), b, fma(Float64(-z), log(t), Float64(Float64(y + x) + z))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a - 0.5), $MachinePrecision] * b + N[((-z) * N[Log[t], $MachinePrecision] + N[(N[(y + x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a - 0.5, b, \mathsf{fma}\left(-z, \log t, \left(y + x\right) + z\right)\right)
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 (log t)) z y)))
(if (<= z -1.75e+222)
t_1
(if (<= z 1.25e+200) (fma b a (fma -0.5 b (+ y x))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - log(t)), z, y);
double tmp;
if (z <= -1.75e+222) {
tmp = t_1;
} else if (z <= 1.25e+200) {
tmp = fma(b, a, fma(-0.5, b, (y + x)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - log(t)), z, y) tmp = 0.0 if (z <= -1.75e+222) tmp = t_1; elseif (z <= 1.25e+200) tmp = fma(b, a, fma(-0.5, b, Float64(y + x))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision]}, If[LessEqual[z, -1.75e+222], t$95$1, If[LessEqual[z, 1.25e+200], N[(b * a + N[(-0.5 * b + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, y\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+222}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+200}:\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(-0.5, b, y + x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7499999999999999e222 or 1.25000000000000005e200 < z Initial program 99.7%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6483.1
Applied rewrites83.1%
Taylor expanded in x around 0
Applied rewrites76.1%
if -1.7499999999999999e222 < z < 1.25000000000000005e200Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6488.1
Applied rewrites88.1%
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6488.1
Applied rewrites88.1%
Final simplification86.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.5e+224)
(- z (* (log t) z))
(if (<= z 1e+200)
(fma b a (fma -0.5 b (+ y x)))
(fma (- 1.0 (log t)) z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.5e+224) {
tmp = z - (log(t) * z);
} else if (z <= 1e+200) {
tmp = fma(b, a, fma(-0.5, b, (y + x)));
} else {
tmp = fma((1.0 - log(t)), z, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.5e+224) tmp = Float64(z - Float64(log(t) * z)); elseif (z <= 1e+200) tmp = fma(b, a, fma(-0.5, b, Float64(y + x))); else tmp = fma(Float64(1.0 - log(t)), z, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.5e+224], N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+200], N[(b * a + N[(-0.5 * b + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+224}:\\
\;\;\;\;z - \log t \cdot z\\
\mathbf{elif}\;z \leq 10^{+200}:\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(-0.5, b, y + x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, x\right)\\
\end{array}
\end{array}
if z < -1.5000000000000001e224Initial program 99.6%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
distribute-lft-inN/A
*-rgt-identityN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6479.8
Applied rewrites79.8%
if -1.5000000000000001e224 < z < 9.9999999999999997e199Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6488.1
Applied rewrites88.1%
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6488.1
Applied rewrites88.1%
if 9.9999999999999997e199 < z Initial program 99.7%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6483.2
Applied rewrites83.2%
Taylor expanded in y around 0
Applied rewrites73.9%
Final simplification86.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.5e+224) (- z (* (log t) z)) (fma b a (fma -0.5 b (+ y x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.5e+224) {
tmp = z - (log(t) * z);
} else {
tmp = fma(b, a, fma(-0.5, b, (y + x)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.5e+224) tmp = Float64(z - Float64(log(t) * z)); else tmp = fma(b, a, fma(-0.5, b, Float64(y + x))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.5e+224], N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(-0.5 * b + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+224}:\\
\;\;\;\;z - \log t \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(-0.5, b, y + x\right)\right)\\
\end{array}
\end{array}
if z < -1.5000000000000001e224Initial program 99.6%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
distribute-lft-inN/A
*-rgt-identityN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6479.8
Applied rewrites79.8%
if -1.5000000000000001e224 < z Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6484.2
Applied rewrites84.2%
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
Final simplification83.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -2e+247) t_1 (if (<= t_1 1e+178) (+ (* -0.5 b) (+ y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -2e+247) {
tmp = t_1;
} else if (t_1 <= 1e+178) {
tmp = (-0.5 * b) + (y + x);
} 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 = (a - 0.5d0) * b
if (t_1 <= (-2d+247)) then
tmp = t_1
else if (t_1 <= 1d+178) then
tmp = ((-0.5d0) * b) + (y + x)
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 = (a - 0.5) * b;
double tmp;
if (t_1 <= -2e+247) {
tmp = t_1;
} else if (t_1 <= 1e+178) {
tmp = (-0.5 * b) + (y + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -2e+247: tmp = t_1 elif t_1 <= 1e+178: tmp = (-0.5 * b) + (y + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -2e+247) tmp = t_1; elseif (t_1 <= 1e+178) tmp = Float64(Float64(-0.5 * b) + Float64(y + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -2e+247) tmp = t_1; elseif (t_1 <= 1e+178) tmp = (-0.5 * b) + (y + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+247], t$95$1, If[LessEqual[t$95$1, 1e+178], N[(N[(-0.5 * b), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{+178}:\\
\;\;\;\;-0.5 \cdot b + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.9999999999999999e247 or 1.0000000000000001e178 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6489.2
Applied rewrites89.2%
if -1.9999999999999999e247 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.0000000000000001e178Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6471.3
Applied rewrites71.3%
Taylor expanded in a around 0
lower-*.f6465.2
Applied rewrites65.2%
Final simplification72.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -5e+154) t_1 (if (<= t_1 1e+178) (+ y x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+154) {
tmp = t_1;
} else if (t_1 <= 1e+178) {
tmp = y + x;
} 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 = (a - 0.5d0) * b
if (t_1 <= (-5d+154)) then
tmp = t_1
else if (t_1 <= 1d+178) then
tmp = y + x
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 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+154) {
tmp = t_1;
} else if (t_1 <= 1e+178) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -5e+154: tmp = t_1 elif t_1 <= 1e+178: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -5e+154) tmp = t_1; elseif (t_1 <= 1e+178) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -5e+154) tmp = t_1; elseif (t_1 <= 1e+178) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+154], t$95$1, If[LessEqual[t$95$1, 1e+178], N[(y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{+178}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.00000000000000004e154 or 1.0000000000000001e178 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6482.9
Applied rewrites82.9%
if -5.00000000000000004e154 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.0000000000000001e178Initial program 99.9%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6491.3
Applied rewrites91.3%
Taylor expanded in z around 0
Applied rewrites64.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -2e+247) (* a b) (if (<= t_1 1e+178) (+ y x) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -2e+247) {
tmp = a * b;
} else if (t_1 <= 1e+178) {
tmp = y + x;
} 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) :: t_1
real(8) :: tmp
t_1 = (a - 0.5d0) * b
if (t_1 <= (-2d+247)) then
tmp = a * b
else if (t_1 <= 1d+178) then
tmp = y + x
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 t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -2e+247) {
tmp = a * b;
} else if (t_1 <= 1e+178) {
tmp = y + x;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -2e+247: tmp = a * b elif t_1 <= 1e+178: tmp = y + x else: tmp = a * b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -2e+247) tmp = Float64(a * b); elseif (t_1 <= 1e+178) tmp = Float64(y + x); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -2e+247) tmp = a * b; elseif (t_1 <= 1e+178) tmp = y + x; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+247], N[(a * b), $MachinePrecision], If[LessEqual[t$95$1, 1e+178], N[(y + x), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+247}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t\_1 \leq 10^{+178}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1.9999999999999999e247 or 1.0000000000000001e178 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around inf
lower-*.f6472.2
Applied rewrites72.2%
if -1.9999999999999999e247 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.0000000000000001e178Initial program 99.9%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6487.9
Applied rewrites87.9%
Taylor expanded in z around 0
Applied rewrites61.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* a b) (+ y x))))
(if (<= (- a 0.5) -10000000000000.0)
t_1
(if (<= (- a 0.5) -0.4999995) (+ (* -0.5 b) (+ y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a * b) + (y + x);
double tmp;
if ((a - 0.5) <= -10000000000000.0) {
tmp = t_1;
} else if ((a - 0.5) <= -0.4999995) {
tmp = (-0.5 * b) + (y + x);
} 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 = (a * b) + (y + x)
if ((a - 0.5d0) <= (-10000000000000.0d0)) then
tmp = t_1
else if ((a - 0.5d0) <= (-0.4999995d0)) then
tmp = ((-0.5d0) * b) + (y + x)
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 = (a * b) + (y + x);
double tmp;
if ((a - 0.5) <= -10000000000000.0) {
tmp = t_1;
} else if ((a - 0.5) <= -0.4999995) {
tmp = (-0.5 * b) + (y + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a * b) + (y + x) tmp = 0 if (a - 0.5) <= -10000000000000.0: tmp = t_1 elif (a - 0.5) <= -0.4999995: tmp = (-0.5 * b) + (y + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a * b) + Float64(y + x)) tmp = 0.0 if (Float64(a - 0.5) <= -10000000000000.0) tmp = t_1; elseif (Float64(a - 0.5) <= -0.4999995) tmp = Float64(Float64(-0.5 * b) + Float64(y + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a * b) + (y + x); tmp = 0.0; if ((a - 0.5) <= -10000000000000.0) tmp = t_1; elseif ((a - 0.5) <= -0.4999995) tmp = (-0.5 * b) + (y + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -10000000000000.0], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4999995], N[(N[(-0.5 * b), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + \left(y + x\right)\\
\mathbf{if}\;a - 0.5 \leq -10000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a - 0.5 \leq -0.4999995:\\
\;\;\;\;-0.5 \cdot b + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -1e13 or -0.499999499999999986 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6483.4
Applied rewrites83.4%
Taylor expanded in a around inf
lower-*.f6483.3
Applied rewrites83.3%
if -1e13 < (-.f64 a #s(literal 1/2 binary64)) < -0.499999499999999986Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6472.7
Applied rewrites72.7%
Taylor expanded in a around 0
lower-*.f6472.5
Applied rewrites72.5%
Final simplification78.1%
(FPCore (x y z t a b) :precision binary64 (fma b a (fma -0.5 b (+ y x))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(b, a, fma(-0.5, b, (y + x)));
}
function code(x, y, z, t, a, b) return fma(b, a, fma(-0.5, b, Float64(y + x))) end
code[x_, y_, z_, t_, a_, b_] := N[(b * a + N[(-0.5 * b + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b, a, \mathsf{fma}\left(-0.5, b, y + x\right)\right)
\end{array}
Initial program 99.9%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval99.9
Applied rewrites99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6478.2
Applied rewrites78.2%
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6478.3
Applied rewrites78.3%
Final simplification78.3%
(FPCore (x y z t a b) :precision binary64 (+ (fma (- a 0.5) b y) x))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a - 0.5), b, y) + x;
}
function code(x, y, z, t, a, b) return Float64(fma(Float64(a - 0.5), b, y) + x) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a - 0.5), $MachinePrecision] * b + y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a - 0.5, b, y\right) + x
\end{array}
Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6478.2
Applied rewrites78.2%
(FPCore (x y z t a b) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a, double b) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return y + x;
}
def code(x, y, z, t, a, b): return y + x
function code(x, y, z, t, a, b) return Float64(y + x) end
function tmp = code(x, y, z, t, a, b) tmp = y + x; end
code[x_, y_, z_, t_, a_, b_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 99.9%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6466.0
Applied rewrites66.0%
Taylor expanded in z around 0
Applied rewrites46.1%
(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 2024235
(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)))