| Alternative 1 | |
|---|---|
| Error | 1.6 |
| Cost | 66244 |
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(t_2 (sqrt (+ x 1.0)))
(t_3 (sqrt (+ 1.0 t))))
(if (<= x 1e-14)
(+
(+ t_2 (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))
(+ t_1 (/ 1.0 (+ t_3 (sqrt t)))))
(+ (/ 1.0 (+ t_2 (sqrt x))) (+ t_1 (- t_3 (sqrt t)))))))double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
double t_2 = sqrt((x + 1.0));
double t_3 = sqrt((1.0 + t));
double tmp;
if (x <= 1e-14) {
tmp = (t_2 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x))) + (t_1 + (1.0 / (t_3 + sqrt(t))));
} else {
tmp = (1.0 / (t_2 + sqrt(x))) + (t_1 + (t_3 - sqrt(t)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))
t_2 = sqrt((x + 1.0d0))
t_3 = sqrt((1.0d0 + t))
if (x <= 1d-14) then
tmp = (t_2 + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))) + (t_1 + (1.0d0 / (t_3 + sqrt(t))))
else
tmp = (1.0d0 / (t_2 + sqrt(x))) + (t_1 + (t_3 - sqrt(t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z));
double t_2 = Math.sqrt((x + 1.0));
double t_3 = Math.sqrt((1.0 + t));
double tmp;
if (x <= 1e-14) {
tmp = (t_2 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x))) + (t_1 + (1.0 / (t_3 + Math.sqrt(t))));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + (t_1 + (t_3 - Math.sqrt(t)));
}
return tmp;
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
def code(x, y, z, t): t_1 = 1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)) t_2 = math.sqrt((x + 1.0)) t_3 = math.sqrt((1.0 + t)) tmp = 0 if x <= 1e-14: tmp = (t_2 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x))) + (t_1 + (1.0 / (t_3 + math.sqrt(t)))) else: tmp = (1.0 / (t_2 + math.sqrt(x))) + (t_1 + (t_3 - math.sqrt(t))) return tmp
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) t_2 = sqrt(Float64(x + 1.0)) t_3 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (x <= 1e-14) tmp = Float64(Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))) + Float64(t_1 + Float64(1.0 / Float64(t_3 + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(t_1 + Float64(t_3 - sqrt(t)))); end return tmp end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 / (sqrt((1.0 + z)) + sqrt(z)); t_2 = sqrt((x + 1.0)); t_3 = sqrt((1.0 + t)); tmp = 0.0; if (x <= 1e-14) tmp = (t_2 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x))) + (t_1 + (1.0 / (t_3 + sqrt(t)))); else tmp = (1.0 / (t_2 + sqrt(x))) + (t_1 + (t_3 - sqrt(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1e-14], N[(N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(t$95$3 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(t$95$3 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\begin{array}{l}
t_1 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{1 + t}\\
\mathbf{if}\;x \leq 10^{-14}:\\
\;\;\;\;\left(t_2 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\right) + \left(t_1 + \frac{1}{t_3 + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{x}} + \left(t_1 + \left(t_3 - \sqrt{t}\right)\right)\\
\end{array}
Results
| Original | 5.5 |
|---|---|
| Target | 0.4 |
| Herbie | 1.6 |
if x < 9.99999999999999999e-15Initial program 2.0
Simplified2.0
[Start]2.0 | \[ \left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\] |
|---|---|
associate-+l+ [=>]2.0 | \[ \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)}
\] |
associate-+l- [=>]2.0 | \[ \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
associate--r- [=>]2.2 | \[ \left(\sqrt{x + 1} - \color{blue}{\left(\left(\sqrt{x} - \sqrt{y + 1}\right) + \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
remove-double-neg [<=]2.2 | \[ \left(\sqrt{x + 1} - \left(\left(\sqrt{x} - \sqrt{y + 1}\right) + \color{blue}{\left(-\left(-\sqrt{y}\right)\right)}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
associate-+l- [=>]2.0 | \[ \left(\sqrt{x + 1} - \color{blue}{\left(\sqrt{x} - \left(\sqrt{y + 1} - \left(-\left(-\sqrt{y}\right)\right)\right)\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]2.0 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{\color{blue}{1 + y}} - \left(-\left(-\sqrt{y}\right)\right)\right)\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
remove-double-neg [=>]2.0 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \color{blue}{\sqrt{y}}\right)\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
sub-neg [=>]2.0 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\left(\sqrt{z + 1} + \left(-\sqrt{z}\right)\right)} + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
sub-neg [<=]2.0 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\left(\sqrt{z + 1} - \sqrt{z}\right)} + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]2.0 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
Applied egg-rr1.2
Simplified1.2
[Start]1.2 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\left(1 + \left(z - z\right)\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
+-commutative [=>]1.2 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\left(\left(z - z\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-inverses [=>]1.2 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
metadata-eval [=>]1.2 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
*-lft-identity [=>]1.2 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\frac{1}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Applied egg-rr1.1
Simplified0.9
[Start]1.1 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\left(1 + t\right) - t\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)
\] |
|---|---|
*-commutative [=>]1.1 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \color{blue}{\frac{1}{\sqrt{1 + t} + \sqrt{t}} \cdot \left(\left(1 + t\right) - t\right)}\right)
\] |
associate--l+ [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}} \cdot \color{blue}{\left(1 + \left(t - t\right)\right)}\right)
\] |
distribute-rgt-in [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \color{blue}{\left(1 \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(t - t\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)}\right)
\] |
+-inverses [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(1 \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}} + \color{blue}{0} \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
+-inverses [<=]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(1 \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}} + \color{blue}{\left(z - z\right)} \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
distribute-rgt-out [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \color{blue}{\frac{1}{\sqrt{1 + t} + \sqrt{t}} \cdot \left(1 + \left(z - z\right)\right)}\right)
\] |
+-commutative [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}} \cdot \color{blue}{\left(\left(z - z\right) + 1\right)}\right)
\] |
+-inverses [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}} \cdot \left(\color{blue}{0} + 1\right)\right)
\] |
metadata-eval [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}} \cdot \color{blue}{1}\right)
\] |
*-rgt-identity [=>]0.9 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \color{blue}{\frac{1}{\sqrt{1 + t} + \sqrt{t}}}\right)
\] |
if 9.99999999999999999e-15 < x Initial program 47.1
Simplified47.1
[Start]47.1 | \[ \left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\] |
|---|---|
associate-+l+ [=>]47.1 | \[ \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)}
\] |
associate-+l- [=>]47.1 | \[ \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
associate--r- [=>]54.5 | \[ \left(\sqrt{x + 1} - \color{blue}{\left(\left(\sqrt{x} - \sqrt{y + 1}\right) + \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
remove-double-neg [<=]54.5 | \[ \left(\sqrt{x + 1} - \left(\left(\sqrt{x} - \sqrt{y + 1}\right) + \color{blue}{\left(-\left(-\sqrt{y}\right)\right)}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
associate-+l- [=>]47.1 | \[ \left(\sqrt{x + 1} - \color{blue}{\left(\sqrt{x} - \left(\sqrt{y + 1} - \left(-\left(-\sqrt{y}\right)\right)\right)\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]47.1 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{\color{blue}{1 + y}} - \left(-\left(-\sqrt{y}\right)\right)\right)\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
remove-double-neg [=>]47.1 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \color{blue}{\sqrt{y}}\right)\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
sub-neg [=>]47.1 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\left(\sqrt{z + 1} + \left(-\sqrt{z}\right)\right)} + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
sub-neg [<=]47.1 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\left(\sqrt{z + 1} - \sqrt{z}\right)} + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]47.1 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)
\] |
Taylor expanded in y around inf 48.7
Applied egg-rr9.6
Simplified9.6
[Start]9.6 | \[ \left(1 + \left(x - x\right)\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
+-commutative [=>]9.6 | \[ \color{blue}{\left(\left(x - x\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-inverses [=>]9.6 | \[ \left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
metadata-eval [=>]9.6 | \[ \color{blue}{1} \cdot \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
*-lft-identity [=>]9.6 | \[ \color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Applied egg-rr9.6
Simplified9.6
[Start]9.6 | \[ \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(1 + \left(z - z\right)\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
+-commutative [=>]9.6 | \[ \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\color{blue}{\left(\left(z - z\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-inverses [=>]9.6 | \[ \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
metadata-eval [=>]9.6 | \[ \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
*-lft-identity [=>]9.6 | \[ \frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\color{blue}{\frac{1}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Final simplification1.6
| Alternative 1 | |
|---|---|
| Error | 1.6 |
| Cost | 66244 |
| Alternative 2 | |
|---|---|
| Error | 2.4 |
| Cost | 39876 |
| Alternative 3 | |
|---|---|
| Error | 1.9 |
| Cost | 39876 |
| Alternative 4 | |
|---|---|
| Error | 1.9 |
| Cost | 39876 |
| Alternative 5 | |
|---|---|
| Error | 2.7 |
| Cost | 39748 |
| Alternative 6 | |
|---|---|
| Error | 2.2 |
| Cost | 27208 |
| Alternative 7 | |
|---|---|
| Error | 3.1 |
| Cost | 26824 |
| Alternative 8 | |
|---|---|
| Error | 3.1 |
| Cost | 26564 |
| Alternative 9 | |
|---|---|
| Error | 6.6 |
| Cost | 20040 |
| Alternative 10 | |
|---|---|
| Error | 22.0 |
| Cost | 13513 |
| Alternative 11 | |
|---|---|
| Error | 9.8 |
| Cost | 13512 |
| Alternative 12 | |
|---|---|
| Error | 6.6 |
| Cost | 13512 |
| Alternative 13 | |
|---|---|
| Error | 40.9 |
| Cost | 13120 |
| Alternative 14 | |
|---|---|
| Error | 41.3 |
| Cost | 6848 |
| Alternative 15 | |
|---|---|
| Error | 41.7 |
| Cost | 6592 |
| Alternative 16 | |
|---|---|
| Error | 41.6 |
| Cost | 64 |
herbie shell --seed 2023073
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))