x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)x + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(z \cdot \left(\sqrt[3]{\sqrt[3]{y} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \cdot \left(\sqrt[3]{\sqrt[3]{y} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \cdot \sqrt[3]{\sqrt[3]{y} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\right)\right)\right)(FPCore (x y z t) :precision binary64 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
(FPCore (x y z t)
:precision binary64
(+
x
(*
(* (cbrt y) (cbrt y))
(*
z
(*
(cbrt (* (cbrt y) (- (tanh (/ t y)) (tanh (/ x y)))))
(*
(cbrt (* (cbrt y) (- (tanh (/ t y)) (tanh (/ x y)))))
(cbrt (* (cbrt y) (- (tanh (/ t y)) (tanh (/ x y)))))))))))double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh((t / y))) - ((double) tanh((x / y)))))))));
}
double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (((double) cbrt(y)) * ((double) cbrt(y)))) * ((double) (z * ((double) (((double) cbrt(((double) (((double) cbrt(y)) * ((double) (((double) tanh((t / y))) - ((double) tanh((x / y))))))))) * ((double) (((double) cbrt(((double) (((double) cbrt(y)) * ((double) (((double) tanh((t / y))) - ((double) tanh((x / y))))))))) * ((double) cbrt(((double) (((double) cbrt(y)) * ((double) (((double) tanh((t / y))) - ((double) tanh((x / y)))))))))))))))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.5 |
|---|---|
| Target | 2.0 |
| Herbie | 2.2 |
Initial program Error: 4.5 bits
SimplifiedError: 2.0 bits
rmApplied add-cube-cbrtError: 2.3 bits
Applied associate-*l*Error: 2.3 bits
SimplifiedError: 2.0 bits
rmApplied add-cube-cbrtError: 2.2 bits
Final simplificationError: 2.2 bits
herbie shell --seed 2020204
(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))))))