3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
3 - \left(x \cdot \left(x \cdot -9\right) + x \cdot 12\right)
(FPCore (x) :precision binary64 (* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))
(FPCore (x) :precision binary64 (- 3.0 (+ (* x (* x -9.0)) (* x 12.0))))
double code(double x) {
return 3.0 * ((((x * 3.0) * x) - (x * 4.0)) + 1.0);
}
double code(double x) {
return 3.0 - ((x * (x * -9.0)) + (x * 12.0));
}












Bits error versus x
Results
| Original | 0.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 576 |
| Alternative 2 | |
|---|---|
| Error | 2.0 |
| Cost | 448 |
| Alternative 3 | |
|---|---|
| Error | 1.0 |
| Cost | 776 |
| Alternative 4 | |
|---|---|
| Error | 1.5 |
| Cost | 962 |
| Alternative 5 | |
|---|---|
| Error | 1.5 |
| Cost | 648 |
| Alternative 6 | |
|---|---|
| Error | 2.0 |
| Cost | 648 |
| Alternative 7 | |
|---|---|
| Error | 21.6 |
| Cost | 64 |
| Alternative 8 | |
|---|---|
| Error | 55.3 |
| Cost | 64 |

Initial program 0.2
Simplified0.1
rmApplied distribute-rgt-in_binary64_187830.1
Simplified0.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021044
(FPCore (x)
:name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(+ 3.0 (- (* (* 9.0 x) x) (* 12.0 x)))
(* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))