Average Error: 10.8 → 10.8
Time: 14.4s
Precision: 64
$e^{\left(-a\right) \cdot a} - e^{\left(-b\right) \cdot b}$
$e^{-a \cdot a} - e^{b \cdot \left(-b\right)}$
e^{\left(-a\right) \cdot a} - e^{\left(-b\right) \cdot b}
e^{-a \cdot a} - e^{b \cdot \left(-b\right)}
double f(double a, double b) {
double r53327568 = a;
double r53327569 = -r53327568;
double r53327570 = r53327569 * r53327568;
double r53327571 = exp(r53327570);
double r53327572 = b;
double r53327573 = -r53327572;
double r53327574 = r53327573 * r53327572;
double r53327575 = exp(r53327574);
double r53327576 = r53327571 - r53327575;
return r53327576;
}


double f(double a, double b) {
double r53327577 = a;
double r53327578 = r53327577 * r53327577;
double r53327579 = -r53327578;
double r53327580 = exp(r53327579);
double r53327581 = b;
double r53327582 = -r53327581;
double r53327583 = r53327581 * r53327582;
double r53327584 = exp(r53327583);
double r53327585 = r53327580 - r53327584;
return r53327585;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 10.8

$e^{\left(-a\right) \cdot a} - e^{\left(-b\right) \cdot b}$
2. Using strategy rm

$\leadsto \color{blue}{e^{\log \left(e^{\left(-a\right) \cdot a}\right)}} - e^{\left(-b\right) \cdot b}$
4. Simplified10.8

$\leadsto e^{\color{blue}{-a \cdot a}} - e^{\left(-b\right) \cdot b}$
5. Final simplification10.8

$\leadsto e^{-a \cdot a} - e^{b \cdot \left(-b\right)}$

# Reproduce

herbie shell --seed 1
(FPCore (a b)
:name "(exp(-a*a) - exp(-b*b))"
(- (exp (* (- a) a)) (exp (* (- b) b))))