Average Error: 4.4 → 3.1
Time: 9.3s
Precision: binary64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.58715896044825459 \cdot 10^{86} \lor \neg \left(y \le 1.96443839642579 \cdot 10^{122}\right):\\ \;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right) + -1 \cdot \frac{x \cdot z}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\right) \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\\ \end{array}\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\begin{array}{l}
\mathbf{if}\;y \le -1.58715896044825459 \cdot 10^{86} \lor \neg \left(y \le 1.96443839642579 \cdot 10^{122}\right):\\
\;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right) + -1 \cdot \frac{x \cdot z}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\right) \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\\

\end{array}
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 (((y <= -1.5871589604482546e+86) || !(y <= 1.96443839642579e+122))) {
		VAR = ((double) (x + ((double) (y * ((double) (((double) (z * ((double) tanh(((double) (t / y)))))) + ((double) (-1.0 * ((double) (((double) (x * z)) / y))))))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (((double) cbrt(((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y)))))))))) * ((double) cbrt(((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y)))))))))))) * ((double) cbrt(((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))))))));
	}
	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
Target1.9
Herbie3.1
\[x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\]

Derivation

  1. Split input into 2 regimes
  2. if y < -1.58715896044825459e86 or 1.96443839642579e122 < y

    1. Initial program 13.4

      \[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*6.3

      \[\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-neg6.3

      \[\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-lft-in6.3

      \[\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)}\]
    7. Taylor expanded around inf 8.0

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

    if -1.58715896044825459e86 < y < 1.96443839642579e122

    1. Initial program 0.6

      \[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 add-cube-cbrt1.0

      \[\leadsto x + \color{blue}{\left(\sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\right) \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.58715896044825459 \cdot 10^{86} \lor \neg \left(y \le 1.96443839642579 \cdot 10^{122}\right):\\ \;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right) + -1 \cdot \frac{x \cdot z}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\right) \cdot \sqrt[3]{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\\ \end{array}\]

Reproduce

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