x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)x + \left(\left(y \cdot \tanh \left(\frac{t}{y}\right)\right) \cdot z + y \cdot \left(\left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)\right)double 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 (x + (((y * tanh((t / y))) * z) + (y * (-tanh((x / y)) * z))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.6 |
|---|---|
| Target | 1.8 |
| Herbie | 1.5 |
Initial program 4.6
rmApplied associate-*l*1.8
rmApplied sub-neg1.8
Applied distribute-lft-in1.8
Applied distribute-lft-in2.0
Simplified2.0
Simplified2.0
rmApplied associate-*r*1.5
Final simplification1.5
herbie shell --seed 2020092
(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))))))