Average Error: 4.8 → 1.6
Time: 12.4s
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 r194928 = x;
        double r194929 = y;
        double r194930 = z;
        double r194931 = r194929 * r194930;
        double r194932 = t;
        double r194933 = r194932 / r194929;
        double r194934 = tanh(r194933);
        double r194935 = r194928 / r194929;
        double r194936 = tanh(r194935);
        double r194937 = r194934 - r194936;
        double r194938 = r194931 * r194937;
        double r194939 = r194928 + r194938;
        return r194939;
}

double f(double x, double y, double z, double t) {
        double r194940 = z;
        double r194941 = -92853.53031221362;
        bool r194942 = r194940 <= r194941;
        double r194943 = 6.807813050062858e-19;
        bool r194944 = r194940 <= r194943;
        double r194945 = !r194944;
        bool r194946 = r194942 || r194945;
        double r194947 = x;
        double r194948 = y;
        double r194949 = t;
        double r194950 = r194949 / r194948;
        double r194951 = tanh(r194950);
        double r194952 = r194947 / r194948;
        double r194953 = tanh(r194952);
        double r194954 = r194951 - r194953;
        double r194955 = r194940 * r194954;
        double r194956 = r194948 * r194955;
        double r194957 = r194947 + r194956;
        double r194958 = r194948 * r194940;
        double r194959 = cbrt(r194954);
        double r194960 = r194959 * r194959;
        double r194961 = r194958 * r194960;
        double r194962 = r194961 * r194959;
        double r194963 = r194947 + r194962;
        double r194964 = r194946 ? r194957 : r194963;
        return r194964;
}

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))))))