| Alternative 1 | |
|---|---|
| Error | 0.4 |
| Cost | 59648 |
(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 (+ 1.0 x))))
(if (<= t 1.3e+29)
(+ (- t_2 (sqrt x)) (+ 1.0 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))
(+
t_1
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ (sqrt x) t_2)))))))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((1.0 + x));
double tmp;
if (t <= 1.3e+29) {
tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
} else {
tmp = t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + t_2)));
}
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) :: tmp
t_1 = 1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))
t_2 = sqrt((1.0d0 + x))
if (t <= 1.3d+29) then
tmp = (t_2 - sqrt(x)) + (1.0d0 + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
else
tmp = t_1 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (sqrt(x) + t_2)))
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((1.0 + x));
double tmp;
if (t <= 1.3e+29) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
} else {
tmp = t_1 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + t_2)));
}
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((1.0 + x)) tmp = 0 if t <= 1.3e+29: tmp = (t_2 - math.sqrt(x)) + (1.0 + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) else: tmp = t_1 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt(x) + t_2))) 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(1.0 + x)) tmp = 0.0 if (t <= 1.3e+29) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); else tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + t_2)))); 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((1.0 + x)); tmp = 0.0; if (t <= 1.3e+29) tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))); else tmp = t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + t_2))); 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[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.3e+29], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $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{1 + x}\\
\mathbf{if}\;t \leq 1.3 \cdot 10^{+29}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(1 + \left(t_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{x} + t_2}\right)\\
\end{array}
Results
| Original | 5.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
if t < 1.3e29Initial program 3.3
Simplified3.3
[Start]3.3 | \[ \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+ [=>]3.3 | \[ \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+ [=>]3.3 | \[ \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+ [<=]3.3 | \[ \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 [=>]3.3 | \[ \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 [=>]3.3 | \[ \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 [=>]3.3 | \[ \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(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \left(t - t\right)\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
|---|---|
+-commutative [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\left(\left(t - t\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
+-inverses [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
metadata-eval [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{1} \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
*-lft-identity [=>]0.6 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{1}{\sqrt{1 + t} + \sqrt{t}}}\right)\right)
\] |
Taylor expanded in y around 0 0.8
Applied egg-rr0.5
Simplified0.5
[Start]0.5 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(1 + \left(\left(1 + \left(z - z\right)\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
|---|---|
+-commutative [=>]0.5 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(1 + \left(\color{blue}{\left(\left(z - z\right) + 1\right)} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
+-inverses [=>]0.5 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(1 + \left(\left(\color{blue}{0} + 1\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
metadata-eval [=>]0.5 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(1 + \left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
*-lft-identity [=>]0.5 | \[ \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(1 + \left(\color{blue}{\frac{1}{\sqrt{1 + z} + \sqrt{z}}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\] |
if 1.3e29 < t Initial program 5.6
Simplified5.6
[Start]5.6 | \[ \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+ [=>]5.6 | \[ \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+ [=>]5.6 | \[ \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+ [<=]5.6 | \[ \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 [=>]5.6 | \[ \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 [=>]5.6 | \[ \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 [=>]5.6 | \[ \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-rr2.4
Simplified2.4
[Start]2.4 | \[ \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 [=>]2.4 | \[ \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 [=>]2.4 | \[ \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 [=>]2.4 | \[ \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 [=>]2.4 | \[ \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 [=>]2.4 | \[ \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-rr2.0
Simplified1.0
[Start]2.0 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\left(y + \left(1 - 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)
\] |
|---|---|
associate-*r/ [=>]2.0 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\color{blue}{\frac{\left(y + \left(1 - y\right)\right) \cdot 1}{\sqrt{1 + y} + \sqrt{y}}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
*-rgt-identity [=>]2.0 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{\color{blue}{y + \left(1 - y\right)}}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
associate-+r- [=>]2.0 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{\color{blue}{\left(y + 1\right) - y}}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
+-commutative [<=]2.0 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{\color{blue}{\left(1 + y\right)} - y}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
associate--l+ [=>]1.0 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{\color{blue}{1 + \left(y - y\right)}}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
Applied egg-rr0.1
Simplified0.1
[Start]0.1 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}} + \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.1 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}} + \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.1 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}} + \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.1 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}} + \left(\color{blue}{1} \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
*-lft-identity [=>]0.1 | \[ \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)} + \left(\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}} + \left(\color{blue}{\frac{1}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\] |
Taylor expanded in t around inf 0.1
Simplified0.1
[Start]0.1 | \[ \frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)
\] |
|---|---|
associate-+r+ [=>]0.1 | \[ \color{blue}{\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}}
\] |
Final simplification0.1
| Alternative 1 | |
|---|---|
| Error | 0.4 |
| Cost | 59648 |
| Alternative 2 | |
|---|---|
| Error | 0.5 |
| Cost | 40008 |
| Alternative 3 | |
|---|---|
| Error | 0.1 |
| Cost | 40004 |
| Alternative 4 | |
|---|---|
| Error | 2.1 |
| Cost | 39880 |
| Alternative 5 | |
|---|---|
| Error | 2.1 |
| Cost | 39880 |
| Alternative 6 | |
|---|---|
| Error | 2.3 |
| Cost | 39752 |
| Alternative 7 | |
|---|---|
| Error | 2.9 |
| Cost | 26692 |
| Alternative 8 | |
|---|---|
| Error | 6.8 |
| Cost | 26568 |
| Alternative 9 | |
|---|---|
| Error | 6.9 |
| Cost | 20040 |
| Alternative 10 | |
|---|---|
| Error | 10.0 |
| Cost | 13512 |
| Alternative 11 | |
|---|---|
| Error | 7.1 |
| Cost | 13512 |
| Alternative 12 | |
|---|---|
| Error | 22.4 |
| Cost | 13380 |
| Alternative 13 | |
|---|---|
| Error | 41.3 |
| Cost | 13120 |
| Alternative 14 | |
|---|---|
| Error | 41.7 |
| Cost | 6848 |
| Alternative 15 | |
|---|---|
| Error | 42.0 |
| Cost | 64 |
herbie shell --seed 2022356
(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))))