Average Error: 4.7 → 1.4
Time: 5.4s
Precision: 64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[x + z \cdot \left(y \cdot \tanh \left(\frac{t}{y}\right) + y \cdot \left(-\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 + z \cdot \left(y \cdot \tanh \left(\frac{t}{y}\right) + y \cdot \left(-\tanh \left(\frac{x}{y}\right)\right)\right)
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) {
	return ((double) (x + ((double) (z * ((double) (((double) (y * ((double) tanh(((double) (t / y)))))) + ((double) (y * ((double) -(((double) tanh(((double) (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
Herbie1.4
\[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 *-commutative4.7

    \[\leadsto x + \color{blue}{\left(z \cdot y\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
  4. Applied associate-*l*1.4

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

    \[\leadsto x + z \cdot \left(y \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(-\tanh \left(\frac{x}{y}\right)\right)\right)}\right)\]
  7. Applied distribute-lft-in1.4

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

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

Reproduce

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