\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{z}{x} \cdot -0.0027777777777778 + \left(\frac{0.083333333333333}{x} + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\right)\right)(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (+ (* (/ z x) -0.0027777777777778) (+ (/ 0.083333333333333 x) (* (+ y 0.0007936500793651) (* z (/ z x)))))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z / x) * -0.0027777777777778) + ((0.083333333333333 / x) + ((y + 0.0007936500793651) * (z * (z / x)))));
}















Bits error versus x















Bits error versus y















Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 1.3 |
| Herbie | 0.4 |
| Alternative 1 | |
|---|---|
| Error | 1.2 |
| Cost | 8256 |
| Alternative 2 | |
|---|---|
| Error | 1.1 |
| Cost | 9026 |
| Alternative 3 | |
|---|---|
| Error | 0.7 |
| Cost | 8712 |
| Alternative 4 | |
|---|---|
| Error | 2.3 |
| Cost | 8449 |
| Alternative 5 | |
|---|---|
| Error | 3.3 |
| Cost | 8321 |
| Alternative 6 | |
|---|---|
| Error | 3.3 |
| Cost | 8193 |
| Alternative 7 | |
|---|---|
| Error | 3.1 |
| Cost | 8258 |
| Alternative 8 | |
|---|---|
| Error | 4.7 |
| Cost | 8130 |
| Alternative 9 | |
|---|---|
| Error | 10.0 |
| Cost | 8081 |
| Alternative 10 | |
|---|---|
| Error | 12.2 |
| Cost | 7232 |
| Alternative 11 | |
|---|---|
| Error | 60.9 |
| Cost | 64 |

Initial program 6.0
Taylor expanded around 0 6.2
Simplified4.1
rmApplied *-un-lft-identity_binary64_140594.1
Applied times-frac_binary64_140650.4
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2021044
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))