Average Error: 4.5 → 2.2
Time: 45.5s
Precision: binary64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[x + \left(y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right) - y \cdot \left(z \cdot \tanh \left(\frac{x}{y}\right)\right)\right)\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
x + \left(y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right) - y \cdot \left(z \cdot \tanh \left(\frac{x}{y}\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 (- (* y (* z (tanh (/ t y)))) (* y (* z (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) (y * ((double) (z * ((double) tanh((t / y))))))) - ((double) (y * ((double) (z * ((double) tanh((x / y)))))))))));
}

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.5
Target2.0
Herbie2.2
\[x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\]

Derivation

  1. Initial program Error: 4.5 bits

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
  2. SimplifiedError: 2.0 bits

    \[\leadsto \color{blue}{x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied sub-negError: 2.0 bits

    \[\leadsto x + y \cdot \left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(-\tanh \left(\frac{x}{y}\right)\right)\right)}\right)\]
  5. Applied distribute-lft-inError: 2.0 bits

    \[\leadsto x + y \cdot \color{blue}{\left(z \cdot \tanh \left(\frac{t}{y}\right) + z \cdot \left(-\tanh \left(\frac{x}{y}\right)\right)\right)}\]
  6. Applied distribute-lft-inError: 2.2 bits

    \[\leadsto x + \color{blue}{\left(y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right) + y \cdot \left(z \cdot \left(-\tanh \left(\frac{x}{y}\right)\right)\right)\right)}\]
  7. Final simplificationError: 2.2 bits

    \[\leadsto x + \left(y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right)\right) - y \cdot \left(z \cdot \tanh \left(\frac{x}{y}\right)\right)\right)\]

Reproduce

herbie shell --seed 2020203 
(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))))))