
(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.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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -2e+85)
(+ x (+ y t_1))
(if (<= t_1 4e+120)
(+ (+ (+ x y) (- z (* z (log t)))) (* -0.5 b))
(+ t_1 (+ x (+ z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -2e+85) {
tmp = x + (y + t_1);
} else if (t_1 <= 4e+120) {
tmp = ((x + y) + (z - (z * log(t)))) + (-0.5 * b);
} else {
tmp = t_1 + (x + (z + y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (t_1 <= (-2d+85)) then
tmp = x + (y + t_1)
else if (t_1 <= 4d+120) then
tmp = ((x + y) + (z - (z * log(t)))) + ((-0.5d0) * b)
else
tmp = t_1 + (x + (z + y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -2e+85) {
tmp = x + (y + t_1);
} else if (t_1 <= 4e+120) {
tmp = ((x + y) + (z - (z * Math.log(t)))) + (-0.5 * b);
} else {
tmp = t_1 + (x + (z + y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -2e+85: tmp = x + (y + t_1) elif t_1 <= 4e+120: tmp = ((x + y) + (z - (z * math.log(t)))) + (-0.5 * b) else: tmp = t_1 + (x + (z + y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -2e+85) tmp = Float64(x + Float64(y + t_1)); elseif (t_1 <= 4e+120) tmp = Float64(Float64(Float64(x + y) + Float64(z - Float64(z * log(t)))) + Float64(-0.5 * b)); else tmp = Float64(t_1 + Float64(x + Float64(z + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (t_1 <= -2e+85) tmp = x + (y + t_1); elseif (t_1 <= 4e+120) tmp = ((x + y) + (z - (z * log(t)))) + (-0.5 * b); else tmp = t_1 + (x + (z + 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[LessEqual[t$95$1, -2e+85], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+120], N[(N[(N[(x + y), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(x + N[(z + y), $MachinePrecision]), $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^{+85}:\\
\;\;\;\;x + \left(y + t\_1\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+120}:\\
\;\;\;\;\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(x + \left(z + y\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -2e85Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 89.6%
if -2e85 < (*.f64 (-.f64 a 1/2) b) < 3.9999999999999999e120Initial program 99.7%
add-sqr-sqrt54.8%
pow254.8%
Applied egg-rr54.8%
unpow254.8%
add-sqr-sqrt99.7%
associate--l+99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in a around 0 94.2%
*-commutative94.2%
Simplified94.2%
if 3.9999999999999999e120 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
add-sqr-sqrt52.6%
pow252.6%
Applied egg-rr52.6%
Taylor expanded in z around 0 93.7%
+-commutative93.7%
Simplified93.7%
Final simplification92.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -5e+82)
(+ x (+ y t_1))
(if (<= t_1 4e+120)
(+ (* z (- 1.0 (log t))) (+ x y))
(+ t_1 (+ x (+ z 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 <= -5e+82) {
tmp = x + (y + t_1);
} else if (t_1 <= 4e+120) {
tmp = (z * (1.0 - log(t))) + (x + y);
} else {
tmp = t_1 + (x + (z + 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 <= (-5d+82)) then
tmp = x + (y + t_1)
else if (t_1 <= 4d+120) then
tmp = (z * (1.0d0 - log(t))) + (x + y)
else
tmp = t_1 + (x + (z + 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 <= -5e+82) {
tmp = x + (y + t_1);
} else if (t_1 <= 4e+120) {
tmp = (z * (1.0 - Math.log(t))) + (x + y);
} else {
tmp = t_1 + (x + (z + y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -5e+82: tmp = x + (y + t_1) elif t_1 <= 4e+120: tmp = (z * (1.0 - math.log(t))) + (x + y) else: tmp = t_1 + (x + (z + 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 <= -5e+82) tmp = Float64(x + Float64(y + t_1)); elseif (t_1 <= 4e+120) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(x + y)); else tmp = Float64(t_1 + Float64(x + Float64(z + 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 <= -5e+82) tmp = x + (y + t_1); elseif (t_1 <= 4e+120) tmp = (z * (1.0 - log(t))) + (x + y); else tmp = t_1 + (x + (z + 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[LessEqual[t$95$1, -5e+82], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+120], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+82}:\\
\;\;\;\;x + \left(y + t\_1\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+120}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(x + \left(z + y\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -5.00000000000000015e82Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 89.8%
if -5.00000000000000015e82 < (*.f64 (-.f64 a 1/2) b) < 3.9999999999999999e120Initial 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 92.8%
if 3.9999999999999999e120 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
add-sqr-sqrt52.6%
pow252.6%
Applied egg-rr52.6%
Taylor expanded in z around 0 93.7%
+-commutative93.7%
Simplified93.7%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= (+ x y) -3e+46)
(+ (+ (+ x y) (- z t_1)) (* -0.5 b))
(+ (* b (- a 0.5)) (- (+ 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 tmp;
if ((x + y) <= -3e+46) {
tmp = ((x + y) + (z - t_1)) + (-0.5 * b);
} else {
tmp = (b * (a - 0.5)) + ((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) :: tmp
t_1 = z * log(t)
if ((x + y) <= (-3d+46)) then
tmp = ((x + y) + (z - t_1)) + ((-0.5d0) * b)
else
tmp = (b * (a - 0.5d0)) + ((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 tmp;
if ((x + y) <= -3e+46) {
tmp = ((x + y) + (z - t_1)) + (-0.5 * b);
} else {
tmp = (b * (a - 0.5)) + ((z + y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if (x + y) <= -3e+46: tmp = ((x + y) + (z - t_1)) + (-0.5 * b) else: tmp = (b * (a - 0.5)) + ((z + y) - t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (Float64(x + y) <= -3e+46) tmp = Float64(Float64(Float64(x + y) + Float64(z - t_1)) + Float64(-0.5 * b)); else tmp = Float64(Float64(b * Float64(a - 0.5)) + 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); tmp = 0.0; if ((x + y) <= -3e+46) tmp = ((x + y) + (z - t_1)) + (-0.5 * b); else tmp = (b * (a - 0.5)) + ((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]}, If[LessEqual[N[(x + y), $MachinePrecision], -3e+46], N[(N[(N[(x + y), $MachinePrecision] + N[(z - t$95$1), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(z + y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;x + y \leq -3 \cdot 10^{+46}:\\
\;\;\;\;\left(\left(x + y\right) + \left(z - t\_1\right)\right) + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(\left(z + y\right) - t\_1\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -3.00000000000000023e46Initial program 99.8%
add-sqr-sqrt54.9%
pow254.9%
Applied egg-rr54.9%
unpow254.9%
add-sqr-sqrt99.8%
associate--l+99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 88.7%
*-commutative88.7%
Simplified88.7%
if -3.00000000000000023e46 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 84.7%
Final simplification85.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.3e+207) (not (<= z 1.8e+205))) (* z (- 1.0 (log t))) (+ (* b (- a 0.5)) (+ x (+ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.3e+207) || !(z <= 1.8e+205)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (b * (a - 0.5)) + (x + (z + 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 ((z <= (-2.3d+207)) .or. (.not. (z <= 1.8d+205))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (b * (a - 0.5d0)) + (x + (z + 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 ((z <= -2.3e+207) || !(z <= 1.8e+205)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (b * (a - 0.5)) + (x + (z + y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.3e+207) or not (z <= 1.8e+205): tmp = z * (1.0 - math.log(t)) else: tmp = (b * (a - 0.5)) + (x + (z + y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.3e+207) || !(z <= 1.8e+205)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(z + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.3e+207) || ~((z <= 1.8e+205))) tmp = z * (1.0 - log(t)); else tmp = (b * (a - 0.5)) + (x + (z + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.3e+207], N[Not[LessEqual[z, 1.8e+205]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+207} \lor \neg \left(z \leq 1.8 \cdot 10^{+205}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + \left(z + y\right)\right)\\
\end{array}
\end{array}
if z < -2.29999999999999995e207 or 1.80000000000000001e205 < z Initial program 99.4%
Taylor expanded in a around 0 99.4%
Taylor expanded in z around -inf 71.8%
Taylor expanded in t around inf 71.8%
log-rec71.8%
sub-neg71.8%
Simplified71.8%
if -2.29999999999999995e207 < z < 1.80000000000000001e205Initial program 99.9%
add-sqr-sqrt52.6%
pow252.6%
Applied egg-rr52.6%
Taylor expanded in z around 0 87.9%
+-commutative87.9%
Simplified87.9%
Final simplification85.8%
(FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ z (- (+ x y) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (z + ((x + y) - (z * log(t))));
}
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 = (b * (a - 0.5d0)) + (z + ((x + y) - (z * log(t))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (z + ((x + y) - (z * Math.log(t))));
}
def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (z + ((x + y) - (z * math.log(t))))
function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(z + Float64(Float64(x + y) - Float64(z * log(t))))) end
function tmp = code(x, y, z, t, a, b) tmp = (b * (a - 0.5)) + (z + ((x + y) - (z * log(t)))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(N[(x + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a - 0.5\right) + \left(z + \left(\left(x + y\right) - z \cdot \log t\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (- z (* z (log t)))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (z - (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 = ((x + y) + (z - (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 ((x + y) + (z - (z * Math.log(t)))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((x + y) + (z - (z * math.log(t)))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(z - Float64(z * log(t)))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (z - (z * log(t)))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.8%
add-sqr-sqrt53.0%
pow253.0%
Applied egg-rr53.0%
unpow253.0%
add-sqr-sqrt99.8%
associate--l+99.8%
*-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -2.45e+23)
x
(if (or (<= x 9.4e-210) (and (not (<= x 1.45e-77)) (<= x 1.8e+25)))
(* a b)
y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.45e+23) {
tmp = x;
} else if ((x <= 9.4e-210) || (!(x <= 1.45e-77) && (x <= 1.8e+25))) {
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 <= (-2.45d+23)) then
tmp = x
else if ((x <= 9.4d-210) .or. (.not. (x <= 1.45d-77)) .and. (x <= 1.8d+25)) 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 <= -2.45e+23) {
tmp = x;
} else if ((x <= 9.4e-210) || (!(x <= 1.45e-77) && (x <= 1.8e+25))) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.45e+23: tmp = x elif (x <= 9.4e-210) or (not (x <= 1.45e-77) and (x <= 1.8e+25)): tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.45e+23) tmp = x; elseif ((x <= 9.4e-210) || (!(x <= 1.45e-77) && (x <= 1.8e+25))) 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 <= -2.45e+23) tmp = x; elseif ((x <= 9.4e-210) || (~((x <= 1.45e-77)) && (x <= 1.8e+25))) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.45e+23], x, If[Or[LessEqual[x, 9.4e-210], And[N[Not[LessEqual[x, 1.45e-77]], $MachinePrecision], LessEqual[x, 1.8e+25]]], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+23}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.4 \cdot 10^{-210} \lor \neg \left(x \leq 1.45 \cdot 10^{-77}\right) \land x \leq 1.8 \cdot 10^{+25}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.4500000000000001e23Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 49.0%
if -2.4500000000000001e23 < x < 9.39999999999999933e-210 or 1.4499999999999999e-77 < x < 1.80000000000000008e25Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 44.5%
*-commutative44.5%
Simplified44.5%
if 9.39999999999999933e-210 < x < 1.4499999999999999e-77 or 1.80000000000000008e25 < x Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 23.6%
Final simplification38.5%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -2e+42) x (if (<= (+ x y) 1e+107) (* a b) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -2e+42) {
tmp = x;
} else if ((x + y) <= 1e+107) {
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 ((x + y) <= (-2d+42)) then
tmp = x
else if ((x + y) <= 1d+107) 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 ((x + y) <= -2e+42) {
tmp = x;
} else if ((x + y) <= 1e+107) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -2e+42: tmp = x elif (x + y) <= 1e+107: tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -2e+42) tmp = x; elseif (Float64(x + y) <= 1e+107) 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 ((x + y) <= -2e+42) tmp = x; elseif ((x + y) <= 1e+107) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e+42], x, If[LessEqual[N[(x + y), $MachinePrecision], 1e+107], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{elif}\;x + y \leq 10^{+107}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < -2.00000000000000009e42Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 34.2%
if -2.00000000000000009e42 < (+.f64 x y) < 9.9999999999999997e106Initial 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 44.7%
*-commutative44.7%
Simplified44.7%
if 9.9999999999999997e106 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.2%
Taylor expanded in b around 0 54.3%
Final simplification43.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.1e+113) (not (<= b 4.6e+37))) (* 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.1e+113) || !(b <= 4.6e+37)) {
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.1d+113)) .or. (.not. (b <= 4.6d+37))) 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.1e+113) || !(b <= 4.6e+37)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.1e+113) or not (b <= 4.6e+37): 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.1e+113) || !(b <= 4.6e+37)) 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.1e+113) || ~((b <= 4.6e+37))) 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.1e+113], N[Not[LessEqual[b, 4.6e+37]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.1 \cdot 10^{+113} \lor \neg \left(b \leq 4.6 \cdot 10^{+37}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -6.09999999999999996e113 or 4.60000000000000005e37 < b 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 73.0%
if -6.09999999999999996e113 < b < 4.60000000000000005e37Initial 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.8%
metadata-eval99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 69.9%
Taylor expanded in b around 0 56.3%
Final simplification63.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 1e+107) (+ x (* b (- a 0.5))) (+ y (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 1e+107) {
tmp = x + (b * (a - 0.5));
} else {
tmp = 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 ((x + y) <= 1d+107) then
tmp = x + (b * (a - 0.5d0))
else
tmp = 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 ((x + y) <= 1e+107) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 1e+107: tmp = x + (b * (a - 0.5)) else: tmp = y + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 1e+107) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 1e+107) tmp = x + (b * (a - 0.5)); else tmp = y + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 1e+107], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 10^{+107}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < 9.9999999999999997e106Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 76.2%
Taylor expanded in y around 0 58.6%
if 9.9999999999999997e106 < (+.f64 x y) Initial program 99.9%
+-commutative99.9%
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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.2%
Taylor expanded in x around 0 57.3%
Taylor expanded in a around 0 33.4%
*-commutative33.4%
Simplified33.4%
Final simplification52.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -1e-150) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -1e-150) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((x + y) <= (-1d-150)) then
tmp = x + t_1
else
tmp = y + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((x + y) <= -1e-150) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (x + y) <= -1e-150: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -1e-150) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -1e-150) tmp = x + t_1; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -1e-150], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{-150}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -1.00000000000000001e-150Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.6%
Taylor expanded in y around 0 55.8%
if -1.00000000000000001e-150 < (+.f64 x y) Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.1%
Taylor expanded in x around 0 63.0%
Final simplification59.7%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (+ (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-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 = x + (y + (((-0.5d0) * b) + (a * b)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (a * b)));
}
def code(x, y, z, t, a, b): return x + (y + ((-0.5 * b) + (a * b)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((-0.5 * b) + (a * b))); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)
\end{array}
Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.3%
sub-neg79.3%
metadata-eval79.3%
+-commutative79.3%
distribute-rgt-out79.3%
+-commutative79.3%
Applied egg-rr79.3%
Final simplification79.3%
(FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ x (+ z y))))
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + (z + y));
}
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 = (b * (a - 0.5d0)) + (x + (z + y))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + (z + y));
}
def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (x + (z + y))
function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(z + y))) end
function tmp = code(x, y, z, t, a, b) tmp = (b * (a - 0.5)) + (x + (z + y)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a - 0.5\right) + \left(x + \left(z + y\right)\right)
\end{array}
Initial program 99.8%
add-sqr-sqrt53.0%
pow253.0%
Applied egg-rr53.0%
Taylor expanded in z around 0 79.6%
+-commutative79.6%
Simplified79.6%
Final simplification79.6%
(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(x + Float64(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[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + b \cdot \left(a - 0.5\right)\right)
\end{array}
Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.3%
Final simplification79.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.4e-51) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.4e-51) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-2.4d-51)) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.4e-51) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.4e-51: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.4e-51) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.4e-51) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.4e-51], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.4e-51Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 38.8%
if -2.4e-51 < x Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 21.3%
Final simplification26.5%
(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.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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 21.5%
Final simplification21.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 2024031
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))