Average Error: 2.4 → 0
Time: 5.4s
Precision: 64
$e^{\alpha \cdot \left(\left(1 - x\right) - 1\right)}$
$e^{\left(-x\right) \cdot \alpha}$
e^{\alpha \cdot \left(\left(1 - x\right) - 1\right)}
e^{\left(-x\right) \cdot \alpha}
double f(double alpha, double x) {
double r539485 = alpha;
double r539486 = 1.0;
double r539487 = x;
double r539488 = r539486 - r539487;
double r539489 = r539488 - r539486;
double r539490 = r539485 * r539489;
double r539491 = exp(r539490);
return r539491;
}


double f(double alpha, double x) {
double r539492 = x;
double r539493 = -r539492;
double r539494 = alpha;
double r539495 = r539493 * r539494;
double r539496 = exp(r539495);
return r539496;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 2.4

$e^{\alpha \cdot \left(\left(1 - x\right) - 1\right)}$
2. Simplified0

$\leadsto \color{blue}{e^{\left(-x\right) \cdot \alpha}}$
3. Final simplification0

$\leadsto e^{\left(-x\right) \cdot \alpha}$

# Reproduce

herbie shell --seed 1
(FPCore (alpha x)
:name "exp(alpha*(1 - x - 1))"
:precision binary32
(exp (* alpha (- (- 1 x) 1))))