Average Error: 4.3 → 1.9
Time: 10.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 + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right) - z \cdot \tanh \left(\frac{x}{y}\right)\right)\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right) - z \cdot \tanh \left(\frac{x}{y}\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))) (* z (tanh (/ x y)))))))
double code(double x, double y, double z, double t) {
	return x + ((y * z) * (tanh(t / y) - tanh(x / y)));
}
double code(double x, double y, double z, double t) {
	return x + (y * ((z * tanh(t / y)) - (z * 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.3
Target1.9
Herbie1.9
\[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 4.3

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
  2. Using strategy rm
  3. Applied associate-*l*_binary64_25601.9

    \[\leadsto x + \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)}\]
  4. Using strategy rm
  5. Applied sub-neg_binary64_25041.9

    \[\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)\]
  6. Applied distribute-rgt-in_binary64_25431.9

    \[\leadsto x + y \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) \cdot z + \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)}\]
  7. Simplified1.9

    \[\leadsto x + y \cdot \left(\color{blue}{z \cdot \tanh \left(\frac{t}{y}\right)} + \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)\]
  8. Simplified1.9

    \[\leadsto x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right) + \color{blue}{z \cdot \left(-\tanh \left(\frac{x}{y}\right)\right)}\right)\]
  9. Final simplification1.9

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

Reproduce

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