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 ((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))));
}
double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (y * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y)))))))) * z)) + x));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.7 |
|---|---|
| Target | 1.9 |
| Herbie | 1.4 |
Initial program 4.7
rmApplied add-log-exp7.0
rmApplied pow17.0
Applied pow17.0
Applied pow17.0
Applied pow-prod-down7.0
Applied pow-prod-down7.0
Simplified1.4
Final simplification1.4
herbie shell --seed 2020121
(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))))))