Average Error: 4.4 → 1.5
Time: 42.6s
Precision: binary64
\[\]
\[\]
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;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original4.4
Target2.1
Herbie1.5
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -6.05824264791788163e306

    1. Initial program 60.4

      \[\]
    2. Simplified0.7

      \[\leadsto \]
    3. Using strategy rm
    4. Applied sub-neg0.7

      \[\leadsto \]
    5. Applied distribute-lft-in0.7

      \[\leadsto \]
    6. Applied distribute-lft-in0.7

      \[\leadsto \]
    7. Taylor expanded around 0 2.4

      \[\leadsto \]
    8. Simplified2.4

      \[\leadsto \]

    if -6.05824264791788163e306 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 7.23103077593706921e286

    1. Initial program 0.6

      \[\]

    if 7.23103077593706921e286 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y)))))

    1. Initial program 45.6

      \[\]
    2. Simplified18.7

      \[\leadsto \]
    3. Using strategy rm
    4. Applied sub-neg18.7

      \[\leadsto \]
    5. Applied distribute-lft-in18.7

      \[\leadsto \]
    6. Applied distribute-lft-in22.4

      \[\leadsto \]
    7. Taylor expanded around 0 16.9

      \[\leadsto \]
    8. Simplified16.9

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \]

Reproduce

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))))))