| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 53060 |
(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 x)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (- t_2 (sqrt y)))
(t_4 (sqrt (+ 1.0 z))))
(if (<= t_3 0.05)
(+ (/ 1.0 (+ (sqrt y) t_2)) (+ (/ 1.0 (+ (sqrt x) t_1)) (- t_4 (sqrt z))))
(+
(- t_1 (sqrt x))
(+
t_3
(+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) (/ 1.0 (+ t_4 (sqrt z)))))))))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 + x));
double t_2 = sqrt((y + 1.0));
double t_3 = t_2 - sqrt(y);
double t_4 = sqrt((1.0 + z));
double tmp;
if (t_3 <= 0.05) {
tmp = (1.0 / (sqrt(y) + t_2)) + ((1.0 / (sqrt(x) + t_1)) + (t_4 - sqrt(z)));
} else {
tmp = (t_1 - sqrt(x)) + (t_3 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 / (t_4 + sqrt(z)))));
}
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) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((y + 1.0d0))
t_3 = t_2 - sqrt(y)
t_4 = sqrt((1.0d0 + z))
if (t_3 <= 0.05d0) then
tmp = (1.0d0 / (sqrt(y) + t_2)) + ((1.0d0 / (sqrt(x) + t_1)) + (t_4 - sqrt(z)))
else
tmp = (t_1 - sqrt(x)) + (t_3 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (1.0d0 / (t_4 + sqrt(z)))))
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 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((y + 1.0));
double t_3 = t_2 - Math.sqrt(y);
double t_4 = Math.sqrt((1.0 + z));
double tmp;
if (t_3 <= 0.05) {
tmp = (1.0 / (Math.sqrt(y) + t_2)) + ((1.0 / (Math.sqrt(x) + t_1)) + (t_4 - Math.sqrt(z)));
} else {
tmp = (t_1 - Math.sqrt(x)) + (t_3 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (1.0 / (t_4 + Math.sqrt(z)))));
}
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 = math.sqrt((1.0 + x)) t_2 = math.sqrt((y + 1.0)) t_3 = t_2 - math.sqrt(y) t_4 = math.sqrt((1.0 + z)) tmp = 0 if t_3 <= 0.05: tmp = (1.0 / (math.sqrt(y) + t_2)) + ((1.0 / (math.sqrt(x) + t_1)) + (t_4 - math.sqrt(z))) else: tmp = (t_1 - math.sqrt(x)) + (t_3 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (1.0 / (t_4 + math.sqrt(z))))) 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 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(y + 1.0)) t_3 = Float64(t_2 - sqrt(y)) t_4 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t_3 <= 0.05) tmp = Float64(Float64(1.0 / Float64(sqrt(y) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(t_4 - sqrt(z)))); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(t_3 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(1.0 / Float64(t_4 + sqrt(z)))))); 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 = sqrt((1.0 + x)); t_2 = sqrt((y + 1.0)); t_3 = t_2 - sqrt(y); t_4 = sqrt((1.0 + z)); tmp = 0.0; if (t_3 <= 0.05) tmp = (1.0 / (sqrt(y) + t_2)) + ((1.0 / (sqrt(x) + t_1)) + (t_4 - sqrt(z))); else tmp = (t_1 - sqrt(x)) + (t_3 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 / (t_4 + sqrt(z))))); 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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.05], N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $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 := \sqrt{1 + x}\\
t_2 := \sqrt{y + 1}\\
t_3 := t_2 - \sqrt{y}\\
t_4 := \sqrt{1 + z}\\
\mathbf{if}\;t_3 \leq 0.05:\\
\;\;\;\;\frac{1}{\sqrt{y} + t_2} + \left(\frac{1}{\sqrt{x} + t_1} + \left(t_4 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(t_3 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \frac{1}{t_4 + \sqrt{z}}\right)\right)\\
\end{array}
Results
| Original | 5.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.2 |
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 0.050000000000000003Initial program 13.7
Simplified13.7
[Start]13.7 | \[ \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+ [=>]13.7 | \[ \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)} + \left(\sqrt{t + 1} - \sqrt{t}\right)
\] |
associate-+l+ [=>]13.7 | \[ \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)}
\] |
associate-+r+ [<=]13.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)}
\] |
+-commutative [=>]13.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)
\] |
+-commutative [=>]13.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)
\] |
+-commutative [=>]13.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right)\right)
\] |
Applied egg-rr4.7
Simplified4.7
[Start]4.7 | \[ \left(1 + \left(x - x\right)\right) \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
|---|---|
+-commutative [=>]4.7 | \[ \color{blue}{\left(\left(x - x\right) + 1\right)} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
+-inverses [=>]4.7 | \[ \left(\color{blue}{0} + 1\right) \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
metadata-eval [=>]4.7 | \[ \color{blue}{1} \cdot \frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
*-lft-identity [=>]4.7 | \[ \color{blue}{\frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
+-commutative [=>]4.7 | \[ \frac{1}{\color{blue}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
Applied egg-rr0.5
Simplified0.5
[Start]0.5 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\left(1 + \left(y - y\right)\right) \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
|---|---|
+-commutative [=>]0.5 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\color{blue}{\left(\left(y - y\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
+-inverses [=>]0.5 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
metadata-eval [=>]0.5 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
*-lft-identity [=>]0.5 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
Taylor expanded in t around inf 61.4
Simplified0.5
[Start]61.4 | \[ \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \sqrt{1 + z}\right)\right) - \sqrt{z}
\] |
|---|---|
associate-+r+ [=>]61.4 | \[ \color{blue}{\left(\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \sqrt{1 + z}\right)} - \sqrt{z}
\] |
+-commutative [<=]61.4 | \[ \left(\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\color{blue}{\sqrt{x} + \sqrt{1 + x}}}\right) + \sqrt{1 + z}\right) - \sqrt{z}
\] |
associate-+r- [<=]0.5 | \[ \color{blue}{\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)}
\] |
associate-+l+ [=>]0.5 | \[ \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)}
\] |
+-commutative [=>]0.5 | \[ \frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1}{\color{blue}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)
\] |
if 0.050000000000000003 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 1.7
Simplified1.7
[Start]1.7 | \[ \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+ [=>]1.7 | \[ \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)} + \left(\sqrt{t + 1} - \sqrt{t}\right)
\] |
associate-+l+ [=>]1.7 | \[ \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)}
\] |
associate-+r+ [<=]1.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)}
\] |
+-commutative [=>]1.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)
\] |
+-commutative [=>]1.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)
\] |
+-commutative [=>]1.7 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right)\right)
\] |
Applied egg-rr0.6
Simplified0.6
[Start]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\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)\right)
\] |
|---|---|
+-commutative [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\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)\right)
\] |
+-inverses [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
metadata-eval [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
*-lft-identity [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\color{blue}{\frac{1}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
Applied egg-rr0.1
Simplified0.1
[Start]0.1 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(1 + \left(t - t\right)\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
|---|---|
+-commutative [=>]0.1 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \color{blue}{\left(\left(t - t\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
+-inverses [=>]0.1 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
metadata-eval [=>]0.1 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \color{blue}{1} \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
*-lft-identity [=>]0.1 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \color{blue}{\frac{1}{\sqrt{1 + t} + \sqrt{t}}}\right)\right)
\] |
Final simplification0.2
| Alternative 1 | |
|---|---|
| Error | 0.5 |
| Cost | 53060 |
| Alternative 2 | |
|---|---|
| Error | 2.2 |
| Cost | 39880 |
| Alternative 3 | |
|---|---|
| Error | 0.7 |
| Cost | 39876 |
| Alternative 4 | |
|---|---|
| Error | 5.3 |
| Cost | 39620 |
| Alternative 5 | |
|---|---|
| Error | 6.2 |
| Cost | 26692 |
| Alternative 6 | |
|---|---|
| Error | 5.6 |
| Cost | 26692 |
| Alternative 7 | |
|---|---|
| Error | 6.4 |
| Cost | 26564 |
| Alternative 8 | |
|---|---|
| Error | 9.8 |
| Cost | 26432 |
| Alternative 9 | |
|---|---|
| Error | 9.7 |
| Cost | 13508 |
| Alternative 10 | |
|---|---|
| Error | 12.7 |
| Cost | 13380 |
| Alternative 11 | |
|---|---|
| Error | 10.4 |
| Cost | 13380 |
| Alternative 12 | |
|---|---|
| Error | 30.9 |
| Cost | 6852 |
| Alternative 13 | |
|---|---|
| Error | 41.9 |
| Cost | 64 |
herbie shell --seed 2023054
(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))))