double 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) {
double VAR;
if ((((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y)))))))))) <= -6.058242647917882e+306)) {
VAR = ((double) (x + ((double) (((double) (y * ((double) (z * ((double) tanh(((double) (t / y)))))))) - ((double) (x * z))))));
} else {
double VAR_1;
if ((((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y)))))))))) <= 7.231030775937069e+286)) {
VAR_1 = ((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (z * t)) - ((double) (y * ((double) (z * ((double) tanh(((double) (x / y))))))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.4 |
|---|---|
| Target | 2.1 |
| Herbie | 1.5 |
if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -6.05824264791788163e306Initial program 60.4
Simplified0.7
rmApplied sub-neg0.7
Applied distribute-lft-in0.7
Applied distribute-lft-in0.7
Taylor expanded around 0 2.4
Simplified2.4
if -6.05824264791788163e306 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 7.23103077593706921e286Initial program 0.6
if 7.23103077593706921e286 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) Initial program 45.6
Simplified18.7
rmApplied sub-neg18.7
Applied distribute-lft-in18.7
Applied distribute-lft-in22.4
Taylor expanded around 0 16.9
Simplified16.9
Final simplification1.5
herbie shell --seed 2020192
(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))))))