Average Error: 0 → 0
Time: 5.2s
Precision: 64
$\frac{1}{\frac{1 + \sqrt{5}}{2} - \frac{1 - \sqrt{5}}{2}}$
$\frac{1}{2 \cdot \frac{\sqrt{5}}{2}}$
\frac{1}{\frac{1 + \sqrt{5}}{2} - \frac{1 - \sqrt{5}}{2}}
\frac{1}{2 \cdot \frac{\sqrt{5}}{2}}
double f() {
double r9180 = 1.0;
double r9181 = 5.0;
double r9182 = sqrt(r9181);
double r9183 = r9180 + r9182;
double r9184 = 2.0;
double r9185 = r9183 / r9184;
double r9186 = r9180 - r9182;
double r9187 = r9186 / r9184;
double r9188 = r9185 - r9187;
double r9189 = r9180 / r9188;
return r9189;
}


double f() {
double r9190 = 1.0;
double r9191 = 2.0;
double r9192 = 5.0;
double r9193 = sqrt(r9192);
double r9194 = 2.0;
double r9195 = r9193 / r9194;
double r9196 = r9191 * r9195;
double r9197 = r9190 / r9196;
return r9197;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0

$\frac{1}{\frac{1 + \sqrt{5}}{2} - \frac{1 - \sqrt{5}}{2}}$
2. Simplified0

$\leadsto \color{blue}{\frac{1}{2 \cdot \frac{\sqrt{5}}{2}}}$
3. Final simplification0

$\leadsto \frac{1}{2 \cdot \frac{\sqrt{5}}{2}}$

# Reproduce

herbie shell --seed 1
(FPCore ()
:name "(1 / (((1 + sqrt(5)) / 2) - ((1 - sqrt(5)) / 2)))"
:precision binary64
(/ 1 (- (/ (+ 1 (sqrt 5)) 2) (/ (- 1 (sqrt 5)) 2))))