| Alternative 1 | |
|---|---|
| Accuracy | 98.3% |
| Cost | 92484 |
(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 (+ (sqrt (+ 1.0 y)) (sqrt y))) (t_2 (sqrt (+ x 1.0))))
(-
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))
(/ (+ t_1 (+ (sqrt x) t_2)) (* (- (- (sqrt x)) t_2) t_1)))))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 = sqrt((1.0 + y)) + sqrt(y);
double t_2 = sqrt((x + 1.0));
return ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) - ((t_1 + (sqrt(x) + t_2)) / ((-sqrt(x) - t_2) * t_1));
}
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
t_1 = sqrt((1.0d0 + y)) + sqrt(y)
t_2 = sqrt((x + 1.0d0))
code = ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t))) - ((t_1 + (sqrt(x) + t_2)) / ((-sqrt(x) - t_2) * t_1))
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 = Math.sqrt((1.0 + y)) + Math.sqrt(y);
double t_2 = Math.sqrt((x + 1.0));
return ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) - ((t_1 + (Math.sqrt(x) + t_2)) / ((-Math.sqrt(x) - t_2) * t_1));
}
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 = math.sqrt((1.0 + y)) + math.sqrt(y) t_2 = math.sqrt((x + 1.0)) return ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) - ((t_1 + (math.sqrt(x) + t_2)) / ((-math.sqrt(x) - t_2) * t_1))
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(sqrt(Float64(1.0 + y)) + sqrt(y)) t_2 = sqrt(Float64(x + 1.0)) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) - Float64(Float64(t_1 + Float64(sqrt(x) + t_2)) / Float64(Float64(Float64(-sqrt(x)) - t_2) * t_1))) 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 = code(x, y, z, t) t_1 = sqrt((1.0 + y)) + sqrt(y); t_2 = sqrt((x + 1.0)); tmp = ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) - ((t_1 + (sqrt(x) + t_2)) / ((-sqrt(x) - t_2) * t_1)); 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[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 + N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] / N[(N[((-N[Sqrt[x], $MachinePrecision]) - t$95$2), $MachinePrecision] * t$95$1), $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 := \sqrt{1 + y} + \sqrt{y}\\
t_2 := \sqrt{x + 1}\\
\left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) - \frac{t_1 + \left(\sqrt{x} + t_2\right)}{\left(\left(-\sqrt{x}\right) - t_2\right) \cdot t_1}
\end{array}
Results
| Original | 91.8% |
|---|---|
| Target | 99.4% |
| Herbie | 99.3% |
Initial program 91.8%
Simplified91.8%
[Start]91.8 | \[ \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+ [=>]91.8 | \[ \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- [=>]91.8 | \[ \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- [=>]90.6 | \[ \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 [<=]90.6 | \[ \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- [=>]91.8 | \[ \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 [=>]91.8 | \[ \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 [=>]91.8 | \[ \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 [=>]91.8 | \[ \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 [<=]91.8 | \[ \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 [=>]91.8 | \[ \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-rr93.2%
[Start]91.8 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
flip-- [=>]92.0 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\frac{\sqrt{1 + z} \cdot \sqrt{1 + z} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
div-inv [=>]92.0 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\left(\sqrt{1 + z} \cdot \sqrt{1 + z} - \sqrt{z} \cdot \sqrt{z}\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
add-sqr-sqrt [<=]65.2 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\left(\color{blue}{\left(1 + z\right)} - \sqrt{z} \cdot \sqrt{z}\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
add-sqr-sqrt [<=]92.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\left(\left(1 + z\right) - \color{blue}{z}\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
associate--l+ [=>]93.2 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\right) + \left(\color{blue}{\left(1 + \left(z - z\right)\right)} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Simplified93.2%
[Start]93.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 [=>]93.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 [=>]93.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 [=>]93.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 [=>]93.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-rr94.4%
[Start]93.2 | \[ \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(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
flip-- [=>]93.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \color{blue}{\frac{\sqrt{1 + y} \cdot \sqrt{1 + y} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
div-inv [=>]93.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \color{blue}{\left(\sqrt{1 + y} \cdot \sqrt{1 + y} - \sqrt{y} \cdot \sqrt{y}\right) \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
add-sqr-sqrt [<=]83.8 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\color{blue}{\left(1 + y\right)} - \sqrt{y} \cdot \sqrt{y}\right) \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
add-sqr-sqrt [<=]93.8 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\left(1 + y\right) - \color{blue}{y}\right) \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
associate--l+ [=>]94.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \color{blue}{\left(1 + \left(y - y\right)\right)} \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Simplified94.4%
[Start]94.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(1 + \left(y - y\right)\right) \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
+-commutative [=>]94.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \color{blue}{\left(\left(y - y\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-inverses [=>]94.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
metadata-eval [=>]94.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \color{blue}{1} \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
*-lft-identity [=>]94.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Applied egg-rr94.6%
[Start]94.4 | \[ \left(\sqrt{x + 1} - \left(\sqrt{x} - \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
add-exp-log [=>]94.4 | \[ \color{blue}{e^{\log \left(\sqrt{x + 1} - \left(\sqrt{x} - \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right)}} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
associate--r- [=>]94.6 | \[ e^{\log \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)}} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]94.6 | \[ e^{\log \color{blue}{\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{x + 1} - \sqrt{x}\right)\right)}} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Applied egg-rr94.9%
[Start]94.6 | \[ e^{\log \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{x + 1} - \sqrt{x}\right)\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
add-exp-log [<=]94.6 | \[ \color{blue}{\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{x + 1} - \sqrt{x}\right)\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
frac-2neg [=>]94.6 | \[ \left(\color{blue}{\frac{-1}{-\left(\sqrt{1 + y} + \sqrt{y}\right)}} + \left(\sqrt{x + 1} - \sqrt{x}\right)\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
flip-- [=>]94.6 | \[ \left(\frac{-1}{-\left(\sqrt{1 + y} + \sqrt{y}\right)} + \color{blue}{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
frac-add [=>]94.6 | \[ \color{blue}{\frac{\left(-1\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right) + \left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}\right)}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{x + 1} + \sqrt{x}\right)}} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Simplified99.3%
[Start]94.9 | \[ \frac{-1 \cdot \left(\sqrt{1 + x} + \sqrt{x}\right) + \left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(x + \left(1 - x\right)\right)}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
|---|---|
cancel-sign-sub-inv [<=]94.9 | \[ \frac{\color{blue}{-1 \cdot \left(\sqrt{1 + x} + \sqrt{x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)}}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
mul-1-neg [=>]94.9 | \[ \frac{\color{blue}{\left(-\left(\sqrt{1 + x} + \sqrt{x}\right)\right)} - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]94.9 | \[ \frac{\left(-\color{blue}{\left(\sqrt{x} + \sqrt{1 + x}\right)}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
distribute-neg-in [=>]94.9 | \[ \frac{\color{blue}{\left(\left(-\sqrt{x}\right) + \left(-\sqrt{1 + x}\right)\right)} - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
unsub-neg [=>]94.9 | \[ \frac{\color{blue}{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right)} - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]94.9 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(\left(1 - x\right) + x\right)}}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
associate-+l- [=>]99.3 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(1 - \left(x - x\right)\right)}}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-inverses [=>]99.3 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(1 - \color{blue}{0}\right)}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
metadata-eval [=>]99.3 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{1}}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
*-rgt-identity [=>]99.3 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \color{blue}{\left(\sqrt{1 + y} + \sqrt{y}\right)}}{\left(-\left(\sqrt{1 + y} + \sqrt{y}\right)\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
distribute-lft-neg-out [=>]99.3 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right)}{\color{blue}{-\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{1 + x} + \sqrt{x}\right)}} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
distribute-rgt-neg-in [=>]99.3 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right)}{\color{blue}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(-\left(\sqrt{1 + x} + \sqrt{x}\right)\right)}} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
+-commutative [=>]99.3 | \[ \frac{\left(\left(-\sqrt{x}\right) - \sqrt{1 + x}\right) - \left(\sqrt{1 + y} + \sqrt{y}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(-\color{blue}{\left(\sqrt{x} + \sqrt{1 + x}\right)}\right)} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\] |
Final simplification99.3%
| Alternative 1 | |
|---|---|
| Accuracy | 98.3% |
| Cost | 92484 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.3% |
| Cost | 79168 |
| Alternative 3 | |
|---|---|
| Accuracy | 97.6% |
| Cost | 66116 |
| Alternative 4 | |
|---|---|
| Accuracy | 97.8% |
| Cost | 40004 |
| Alternative 5 | |
|---|---|
| Accuracy | 96.0% |
| Cost | 39876 |
| Alternative 6 | |
|---|---|
| Accuracy | 96.7% |
| Cost | 39876 |
| Alternative 7 | |
|---|---|
| Accuracy | 95.5% |
| Cost | 39748 |
| Alternative 8 | |
|---|---|
| Accuracy | 93.1% |
| Cost | 26820 |
| Alternative 9 | |
|---|---|
| Accuracy | 91.1% |
| Cost | 26696 |
| Alternative 10 | |
|---|---|
| Accuracy | 91.2% |
| Cost | 26696 |
| Alternative 11 | |
|---|---|
| Accuracy | 90.4% |
| Cost | 26692 |
| Alternative 12 | |
|---|---|
| Accuracy | 91.8% |
| Cost | 26692 |
| Alternative 13 | |
|---|---|
| Accuracy | 90.2% |
| Cost | 26628 |
| Alternative 14 | |
|---|---|
| Accuracy | 91.0% |
| Cost | 26568 |
| Alternative 15 | |
|---|---|
| Accuracy | 89.4% |
| Cost | 13512 |
| Alternative 16 | |
|---|---|
| Accuracy | 89.6% |
| Cost | 13512 |
| Alternative 17 | |
|---|---|
| Accuracy | 62.3% |
| Cost | 13380 |
| Alternative 18 | |
|---|---|
| Accuracy | 81.2% |
| Cost | 13380 |
| Alternative 19 | |
|---|---|
| Accuracy | 84.9% |
| Cost | 13380 |
| Alternative 20 | |
|---|---|
| Accuracy | 65.2% |
| Cost | 13248 |
| Alternative 21 | |
|---|---|
| Accuracy | 35.8% |
| Cost | 13120 |
| Alternative 22 | |
|---|---|
| Accuracy | 35.2% |
| Cost | 6848 |
| Alternative 23 | |
|---|---|
| Accuracy | 34.7% |
| Cost | 64 |
herbie shell --seed 2023138
(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))))