Average Error: 1.0 → 0
Time: 2.9s
Precision: 64
$\frac{1}{10} + \frac{2}{10}$
$\frac{1}{\sqrt{10}} \cdot \left(\frac{1}{\sqrt{10}} + \frac{2}{\sqrt{10}}\right)$
\frac{1}{10} + \frac{2}{10}
\frac{1}{\sqrt{10}} \cdot \left(\frac{1}{\sqrt{10}} + \frac{2}{\sqrt{10}}\right)
double f() {
double r1865195 = 1.0;
double r1865196 = 10.0;
double r1865197 = r1865195 / r1865196;
double r1865198 = 2.0;
double r1865199 = r1865198 / r1865196;
double r1865200 = r1865197 + r1865199;
return r1865200;
}


double f() {
double r1865201 = 1.0;
double r1865202 = 10.0;
double r1865203 = sqrt(r1865202);
double r1865204 = r1865201 / r1865203;
double r1865205 = 1.0;
double r1865206 = r1865205 / r1865203;
double r1865207 = 2.0;
double r1865208 = r1865207 / r1865203;
double r1865209 = r1865206 + r1865208;
double r1865210 = r1865204 * r1865209;
return r1865210;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 1.0

$\frac{1}{10} + \frac{2}{10}$
2. Using strategy rm

$\leadsto \frac{1}{10} + \frac{2}{\color{blue}{\sqrt{10} \cdot \sqrt{10}}}$
4. Applied *-un-lft-identity1.0

$\leadsto \frac{1}{10} + \frac{\color{blue}{1 \cdot 2}}{\sqrt{10} \cdot \sqrt{10}}$
5. Applied times-frac1.0

$\leadsto \frac{1}{10} + \color{blue}{\frac{1}{\sqrt{10}} \cdot \frac{2}{\sqrt{10}}}$

$\leadsto \frac{1}{\color{blue}{\sqrt{10} \cdot \sqrt{10}}} + \frac{1}{\sqrt{10}} \cdot \frac{2}{\sqrt{10}}$
7. Applied *-un-lft-identity0

$\leadsto \frac{\color{blue}{1 \cdot 1}}{\sqrt{10} \cdot \sqrt{10}} + \frac{1}{\sqrt{10}} \cdot \frac{2}{\sqrt{10}}$
8. Applied times-frac1.0

$\leadsto \color{blue}{\frac{1}{\sqrt{10}} \cdot \frac{1}{\sqrt{10}}} + \frac{1}{\sqrt{10}} \cdot \frac{2}{\sqrt{10}}$
9. Applied distribute-lft-out0

$\leadsto \color{blue}{\frac{1}{\sqrt{10}} \cdot \left(\frac{1}{\sqrt{10}} + \frac{2}{\sqrt{10}}\right)}$
10. Final simplification0

$\leadsto \frac{1}{\sqrt{10}} \cdot \left(\frac{1}{\sqrt{10}} + \frac{2}{\sqrt{10}}\right)$

# Reproduce

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