Average Error: 4.8 → 1.6
Time: 12.3s
Precision: 64
\[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}\;z \le -92853.5303122136247 \lor \neg \left(z \le 6.8078130500628578 \cdot 10^{-19}\right):\\ \;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y \cdot z\right) \cdot \left(\sqrt[3]{\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)} \cdot \sqrt[3]{\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)}\right)\right) \cdot \sqrt[3]{\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\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}\;z \le -92853.5303122136247 \lor \neg \left(z \le 6.8078130500628578 \cdot 10^{-19}\right):\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r382977 = x;
        double r382978 = y;
        double r382979 = z;
        double r382980 = r382978 * r382979;
        double r382981 = t;
        double r382982 = r382981 / r382978;
        double r382983 = tanh(r382982);
        double r382984 = r382977 / r382978;
        double r382985 = tanh(r382984);
        double r382986 = r382983 - r382985;
        double r382987 = r382980 * r382986;
        double r382988 = r382977 + r382987;
        return r382988;
}

double f(double x, double y, double z, double t) {
        double r382989 = z;
        double r382990 = -92853.53031221362;
        bool r382991 = r382989 <= r382990;
        double r382992 = 6.807813050062858e-19;
        bool r382993 = r382989 <= r382992;
        double r382994 = !r382993;
        bool r382995 = r382991 || r382994;
        double r382996 = x;
        double r382997 = y;
        double r382998 = t;
        double r382999 = r382998 / r382997;
        double r383000 = tanh(r382999);
        double r383001 = r382996 / r382997;
        double r383002 = tanh(r383001);
        double r383003 = r383000 - r383002;
        double r383004 = r382989 * r383003;
        double r383005 = r382997 * r383004;
        double r383006 = r382996 + r383005;
        double r383007 = r382997 * r382989;
        double r383008 = cbrt(r383003);
        double r383009 = r383008 * r383008;
        double r383010 = r383007 * r383009;
        double r383011 = r383010 * r383008;
        double r383012 = r382996 + r383011;
        double r383013 = r382995 ? r383006 : r383012;
        return r383013;
}

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.8
Target2.1
Herbie1.6
\[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 z < -92853.53031221362 or 6.807813050062858e-19 < z

    1. Initial program 9.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*3.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)}\]

    if -92853.53031221362 < z < 6.807813050062858e-19

    1. Initial program 0.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 add-cube-cbrt0.4

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

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

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

Reproduce

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