Average Error: 0.6 → 0.4
Time: 7.6s
Precision: 64
$e^{x} - e^{1}$
$\left(\sqrt{e^{1}} + \sqrt{e^{x}}\right) \cdot \left(\sqrt{e^{x}} - \sqrt{e^{1}}\right)$
e^{x} - e^{1}
\left(\sqrt{e^{1}} + \sqrt{e^{x}}\right) \cdot \left(\sqrt{e^{x}} - \sqrt{e^{1}}\right)
double f(double x) {
double r45976612 = x;
double r45976613 = exp(r45976612);
double r45976614 = 1.0;
double r45976615 = exp(r45976614);
double r45976616 = r45976613 - r45976615;
return r45976616;
}


double f(double x) {
double r45976617 = 1.0;
double r45976618 = exp(r45976617);
double r45976619 = sqrt(r45976618);
double r45976620 = x;
double r45976621 = exp(r45976620);
double r45976622 = sqrt(r45976621);
double r45976623 = r45976619 + r45976622;
double r45976624 = r45976622 - r45976619;
double r45976625 = r45976623 * r45976624;
return r45976625;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.6

$e^{x} - e^{1}$
2. Using strategy rm

$\leadsto e^{x} - \color{blue}{\sqrt{e^{1}} \cdot \sqrt{e^{1}}}$

$\leadsto \color{blue}{\sqrt{e^{x}} \cdot \sqrt{e^{x}}} - \sqrt{e^{1}} \cdot \sqrt{e^{1}}$
5. Applied difference-of-squares0.4

$\leadsto \color{blue}{\left(\sqrt{e^{x}} + \sqrt{e^{1}}\right) \cdot \left(\sqrt{e^{x}} - \sqrt{e^{1}}\right)}$
6. Final simplification0.4

$\leadsto \left(\sqrt{e^{1}} + \sqrt{e^{x}}\right) \cdot \left(\sqrt{e^{x}} - \sqrt{e^{1}}\right)$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "exp(x)-exp(1)"
(- (exp x) (exp 1.0)))