Average Error: 4.8 → 1.6
Time: 8.5s
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 r322413 = x;
        double r322414 = y;
        double r322415 = z;
        double r322416 = r322414 * r322415;
        double r322417 = t;
        double r322418 = r322417 / r322414;
        double r322419 = tanh(r322418);
        double r322420 = r322413 / r322414;
        double r322421 = tanh(r322420);
        double r322422 = r322419 - r322421;
        double r322423 = r322416 * r322422;
        double r322424 = r322413 + r322423;
        return r322424;
}

double f(double x, double y, double z, double t) {
        double r322425 = z;
        double r322426 = -92853.53031221362;
        bool r322427 = r322425 <= r322426;
        double r322428 = 6.807813050062858e-19;
        bool r322429 = r322425 <= r322428;
        double r322430 = !r322429;
        bool r322431 = r322427 || r322430;
        double r322432 = x;
        double r322433 = y;
        double r322434 = t;
        double r322435 = r322434 / r322433;
        double r322436 = tanh(r322435);
        double r322437 = r322432 / r322433;
        double r322438 = tanh(r322437);
        double r322439 = r322436 - r322438;
        double r322440 = r322425 * r322439;
        double r322441 = r322433 * r322440;
        double r322442 = r322432 + r322441;
        double r322443 = r322433 * r322425;
        double r322444 = cbrt(r322439);
        double r322445 = r322444 * r322444;
        double r322446 = r322443 * r322445;
        double r322447 = r322446 * r322444;
        double r322448 = r322432 + r322447;
        double r322449 = r322431 ? r322442 : r322448;
        return r322449;
}

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