Average Error: 4.7 → 2.1
Time: 37.2s
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 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))) - (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.7
Target2.0
Herbie2.1
\[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.7

    \[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*_binary642.0

    \[\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_binary642.0

    \[\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_binary642.0

    \[\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. Applied distribute-rgt-in_binary642.1

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

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

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

    \[\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 2020277 
(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))))))