x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot z + xdouble code(double x, double y, double z, double t) {
return (x + ((y * z) * (tanh((t / y)) - tanh((x / y)))));
}
double code(double x, double y, double z, double t) {
return (((y * (tanh((t / y)) - tanh((x / y)))) * z) + x);
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.5 |
|---|---|
| Target | 1.8 |
| Herbie | 1.4 |
Initial program 4.5
Simplified1.8
rmApplied add-cube-cbrt2.2
Applied associate-*l*2.2
rmApplied fma-udef2.2
Simplified1.4
Final simplification1.4
herbie shell --seed 2020079 +o rules:numerics
(FPCore (x y z t)
:name "SynthBasics:moogVCF from YampaSynth-0.2"
:precision binary64
:herbie-target
(+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))