SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.1% → 97.1%
Time: 12.3s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
	return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t):
	return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 93.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
	return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t):
	return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\end{array}

Alternative 1: 97.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-z\right) \cdot \tanh \left(\frac{x}{y}\right)\right), y, x\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (fma (fma (tanh (/ t y)) z (* (- z) (tanh (/ x y)))) y x))
double code(double x, double y, double z, double t) {
	return fma(fma(tanh((t / y)), z, (-z * tanh((x / y)))), y, x);
}
function code(x, y, z, t)
	return fma(fma(tanh(Float64(t / y)), z, Float64(Float64(-z) * tanh(Float64(x / y)))), y, x)
end
code[x_, y_, z_, t_] := N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] * z + N[((-z) * N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-z\right) \cdot \tanh \left(\frac{x}{y}\right)\right), y, x\right)
\end{array}
Derivation
  1. Initial program 94.7%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
    2. +-commutativeN/A

      \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
    3. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} + x \]
    4. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
    5. associate-*l*N/A

      \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
    6. *-commutativeN/A

      \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
    7. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
    9. lower-*.f6498.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
  4. Applied rewrites98.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
    3. lift--.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{fma}\left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right)\right)}, y, x\right) \]
    5. distribute-rgt-inN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\tanh \left(\frac{t}{y}\right) \cdot z + \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z}, y, x\right) \]
    6. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z\right)}, y, x\right) \]
    7. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z}\right), y, x\right) \]
    8. lower-neg.f6498.9

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(-\tanh \left(\frac{x}{y}\right)\right)} \cdot z\right), y, x\right) \]
  6. Applied rewrites98.9%

    \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)}, y, x\right) \]
  7. Final simplification98.9%

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-z\right) \cdot \tanh \left(\frac{x}{y}\right)\right), y, x\right) \]
  8. Add Preprocessing

Alternative 2: 97.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (fma (* (- (tanh (/ t y)) (tanh (/ x y))) z) y x))
double code(double x, double y, double z, double t) {
	return fma(((tanh((t / y)) - tanh((x / y))) * z), y, x);
}
function code(x, y, z, t)
	return fma(Float64(Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))) * z), y, x)
end
code[x_, y_, z_, t_] := N[(N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)
\end{array}
Derivation
  1. Initial program 94.7%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
    2. +-commutativeN/A

      \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
    3. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} + x \]
    4. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
    5. associate-*l*N/A

      \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
    6. *-commutativeN/A

      \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
    7. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
    9. lower-*.f6498.9

      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
  4. Applied rewrites98.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)} \]
  5. Add Preprocessing

Alternative 3: 78.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{\left(-x\right) \cdot z}{y}\right), y, x\right)\\ \mathbf{if}\;t \leq -2.9 \cdot 10^{-103}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-166}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (fma (fma (tanh (/ t y)) z (/ (* (- x) z) y)) y x)))
   (if (<= t -2.9e-103)
     t_1
     (if (<= t 1.22e-166) (fma (* (- (/ t y) (tanh (/ x y))) z) y x) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = fma(fma(tanh((t / y)), z, ((-x * z) / y)), y, x);
	double tmp;
	if (t <= -2.9e-103) {
		tmp = t_1;
	} else if (t <= 1.22e-166) {
		tmp = fma((((t / y) - tanh((x / y))) * z), y, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = fma(fma(tanh(Float64(t / y)), z, Float64(Float64(Float64(-x) * z) / y)), y, x)
	tmp = 0.0
	if (t <= -2.9e-103)
		tmp = t_1;
	elseif (t <= 1.22e-166)
		tmp = fma(Float64(Float64(Float64(t / y) - tanh(Float64(x / y))) * z), y, x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] * z + N[(N[((-x) * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -2.9e-103], t$95$1, If[LessEqual[t, 1.22e-166], N[(N[(N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{\left(-x\right) \cdot z}{y}\right), y, x\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.22 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.8999999999999999e-103 or 1.22e-166 < t

    1. Initial program 95.0%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} + x \]
      4. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
      6. *-commutativeN/A

        \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
      9. lower-*.f6499.1

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
    4. Applied rewrites99.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
      3. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right)\right)}, y, x\right) \]
      5. distribute-rgt-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\tanh \left(\frac{t}{y}\right) \cdot z + \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z}, y, x\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z\right)}, y, x\right) \]
      7. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z}\right), y, x\right) \]
      8. lower-neg.f6499.1

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(-\tanh \left(\frac{x}{y}\right)\right)} \cdot z\right), y, x\right) \]
    6. Applied rewrites99.1%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)}, y, x\right) \]
    7. Taylor expanded in y around inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\frac{-1 \cdot \left(x \cdot z\right) + \frac{-1}{2} \cdot \frac{z \cdot \left(-1 \cdot {x}^{2} + {x}^{2}\right)}{y}}{y}}\right), y, x\right) \]
    8. Applied rewrites78.2%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\frac{\mathsf{fma}\left(z, \frac{0}{y}, x \cdot z\right)}{-y}}\right), y, x\right) \]
    9. Step-by-step derivation
      1. Applied rewrites78.2%

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

      if -2.8999999999999999e-103 < t < 1.22e-166

      1. Initial program 94.1%

        \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} + x \]
        4. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
        5. associate-*l*N/A

          \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
        9. lower-*.f6498.4

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
      4. Applied rewrites98.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)} \]
      5. Taylor expanded in t around 0

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
      6. Step-by-step derivation
        1. lower-/.f6495.1

          \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
      7. Applied rewrites95.1%

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
    10. Recombined 2 regimes into one program.
    11. Final simplification83.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{-103}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{\left(-x\right) \cdot z}{y}\right), y, x\right)\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-166}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{\left(-x\right) \cdot z}{y}\right), y, x\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 4: 78.5% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{-z}{y} \cdot x\right), y, x\right)\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-80}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (fma (fma (tanh (/ t y)) z (* (/ (- z) y) x)) y x)))
       (if (<= t -3.6e-10)
         t_1
         (if (<= t 2.6e-80) (fma (* (- (/ t y) (tanh (/ x y))) z) y x) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = fma(fma(tanh((t / y)), z, ((-z / y) * x)), y, x);
    	double tmp;
    	if (t <= -3.6e-10) {
    		tmp = t_1;
    	} else if (t <= 2.6e-80) {
    		tmp = fma((((t / y) - tanh((x / y))) * z), y, x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = fma(fma(tanh(Float64(t / y)), z, Float64(Float64(Float64(-z) / y) * x)), y, x)
    	tmp = 0.0
    	if (t <= -3.6e-10)
    		tmp = t_1;
    	elseif (t <= 2.6e-80)
    		tmp = fma(Float64(Float64(Float64(t / y) - tanh(Float64(x / y))) * z), y, x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] * z + N[(N[((-z) / y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t, -3.6e-10], t$95$1, If[LessEqual[t, 2.6e-80], N[(N[(N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{-z}{y} \cdot x\right), y, x\right)\\
    \mathbf{if}\;t \leq -3.6 \cdot 10^{-10}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq 2.6 \cdot 10^{-80}:\\
    \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -3.6e-10 or 2.6000000000000001e-80 < t

      1. Initial program 95.0%

        \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} + x \]
        4. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
        5. associate-*l*N/A

          \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
        9. lower-*.f6499.6

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
      4. Applied rewrites99.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
        3. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
        4. sub-negN/A

          \[\leadsto \mathsf{fma}\left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right)\right)}, y, x\right) \]
        5. distribute-rgt-inN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\tanh \left(\frac{t}{y}\right) \cdot z + \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z}, y, x\right) \]
        6. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z\right)}, y, x\right) \]
        7. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z}\right), y, x\right) \]
        8. lower-neg.f6499.6

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(-\tanh \left(\frac{x}{y}\right)\right)} \cdot z\right), y, x\right) \]
      6. Applied rewrites99.6%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)}, y, x\right) \]
      7. Taylor expanded in y around inf

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{-1 \cdot \frac{x \cdot z}{y}}\right), y, x\right) \]
      8. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, -1 \cdot \color{blue}{\left(x \cdot \frac{z}{y}\right)}\right), y, x\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(-1 \cdot x\right) \cdot \frac{z}{y}}\right), y, x\right) \]
        3. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(-1 \cdot x\right) \cdot \frac{z}{y}}\right), y, x\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{z}{y}\right), y, x\right) \]
        5. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(-x\right)} \cdot \frac{z}{y}\right), y, x\right) \]
        6. lower-/.f6473.8

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-x\right) \cdot \color{blue}{\frac{z}{y}}\right), y, x\right) \]
      9. Applied rewrites73.8%

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

      if -3.6e-10 < t < 2.6000000000000001e-80

      1. Initial program 94.4%

        \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} + x \]
        4. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
        5. associate-*l*N/A

          \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
        9. lower-*.f6498.1

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
      4. Applied rewrites98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)} \]
      5. Taylor expanded in t around 0

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
      6. Step-by-step derivation
        1. lower-/.f6491.3

          \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
      7. Applied rewrites91.3%

        \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification82.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{-z}{y} \cdot x\right), y, x\right)\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-80}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \frac{-z}{y} \cdot x\right), y, x\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 70.8% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{1}{\frac{-1 - \frac{\frac{t \cdot t}{x} + t}{x}}{x}}, z, x\right)\\ \mathbf{if}\;t \leq -1.06 \cdot 10^{+172}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.28 \cdot 10^{+160}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (fma (/ 1.0 (/ (- -1.0 (/ (+ (/ (* t t) x) t) x)) x)) z x)))
       (if (<= t -1.06e+172)
         t_1
         (if (<= t 1.28e+160) (fma (* (- (/ t y) (tanh (/ x y))) z) y x) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = fma((1.0 / ((-1.0 - ((((t * t) / x) + t) / x)) / x)), z, x);
    	double tmp;
    	if (t <= -1.06e+172) {
    		tmp = t_1;
    	} else if (t <= 1.28e+160) {
    		tmp = fma((((t / y) - tanh((x / y))) * z), y, x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = fma(Float64(1.0 / Float64(Float64(-1.0 - Float64(Float64(Float64(Float64(t * t) / x) + t) / x)) / x)), z, x)
    	tmp = 0.0
    	if (t <= -1.06e+172)
    		tmp = t_1;
    	elseif (t <= 1.28e+160)
    		tmp = fma(Float64(Float64(Float64(t / y) - tanh(Float64(x / y))) * z), y, x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 / N[(N[(-1.0 - N[(N[(N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[t, -1.06e+172], t$95$1, If[LessEqual[t, 1.28e+160], N[(N[(N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(\frac{1}{\frac{-1 - \frac{\frac{t \cdot t}{x} + t}{x}}{x}}, z, x\right)\\
    \mathbf{if}\;t \leq -1.06 \cdot 10^{+172}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq 1.28 \cdot 10^{+160}:\\
    \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -1.05999999999999996e172 or 1.27999999999999994e160 < t

      1. Initial program 100.0%

        \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

        \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
        3. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
        4. lower--.f6425.0

          \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
      5. Applied rewrites25.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites7.0%

          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
        2. Taylor expanded in x around -inf

          \[\leadsto \mathsf{fma}\left(\frac{1}{-1 \cdot \frac{1 + -1 \cdot \frac{-1 \cdot \frac{{t}^{2}}{x} - t}{x}}{x}}, z, x\right) \]
        3. Step-by-step derivation
          1. Applied rewrites63.3%

            \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{1 - \frac{-\left(\frac{t \cdot t}{x} + t\right)}{x}}{-x}}, z, x\right) \]

          if -1.05999999999999996e172 < t < 1.27999999999999994e160

          1. Initial program 93.4%

            \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
            3. lift-*.f64N/A

              \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} + x \]
            4. lift-*.f64N/A

              \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
            5. associate-*l*N/A

              \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
            6. *-commutativeN/A

              \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
            7. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
            8. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
            9. lower-*.f6498.6

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z}, y, x\right) \]
          4. Applied rewrites98.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)} \]
          5. Taylor expanded in t around 0

            \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
          6. Step-by-step derivation
            1. lower-/.f6479.7

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
          7. Applied rewrites79.7%

            \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right) \]
        4. Recombined 2 regimes into one program.
        5. Final simplification76.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.06 \cdot 10^{+172}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{-1 - \frac{\frac{t \cdot t}{x} + t}{x}}{x}}, z, x\right)\\ \mathbf{elif}\;t \leq 1.28 \cdot 10^{+160}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{-1 - \frac{\frac{t \cdot t}{x} + t}{x}}{x}}, z, x\right)\\ \end{array} \]
        6. Add Preprocessing

        Alternative 6: 64.0% accurate, 3.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{-115}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{-1 - \frac{\frac{t \cdot t}{x} + t}{x}}{x}}, z, x\right)\\ \mathbf{elif}\;y \leq 1200000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} - -1}{t}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= y 1.7e-115)
           (fma (/ 1.0 (/ (- -1.0 (/ (+ (/ (* t t) x) t) x)) x)) z x)
           (if (<= y 1200000000000.0)
             (fma (/ 1.0 (/ (- (/ (+ (/ (* x x) t) x) t) -1.0) t)) z x)
             (fma t z (- x (* x z))))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (y <= 1.7e-115) {
        		tmp = fma((1.0 / ((-1.0 - ((((t * t) / x) + t) / x)) / x)), z, x);
        	} else if (y <= 1200000000000.0) {
        		tmp = fma((1.0 / ((((((x * x) / t) + x) / t) - -1.0) / t)), z, x);
        	} else {
        		tmp = fma(t, z, (x - (x * z)));
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (y <= 1.7e-115)
        		tmp = fma(Float64(1.0 / Float64(Float64(-1.0 - Float64(Float64(Float64(Float64(t * t) / x) + t) / x)) / x)), z, x);
        	elseif (y <= 1200000000000.0)
        		tmp = fma(Float64(1.0 / Float64(Float64(Float64(Float64(Float64(Float64(x * x) / t) + x) / t) - -1.0) / t)), z, x);
        	else
        		tmp = fma(t, z, Float64(x - Float64(x * z)));
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[y, 1.7e-115], N[(N[(1.0 / N[(N[(-1.0 - N[(N[(N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[y, 1200000000000.0], N[(N[(1.0 / N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / t), $MachinePrecision] - -1.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], N[(t * z + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq 1.7 \cdot 10^{-115}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{-1 - \frac{\frac{t \cdot t}{x} + t}{x}}{x}}, z, x\right)\\
        
        \mathbf{elif}\;y \leq 1200000000000:\\
        \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} - -1}{t}}, z, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < 1.6999999999999999e-115

          1. Initial program 94.9%

            \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
          2. Add Preprocessing
          3. Taylor expanded in y around inf

            \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
            3. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
            4. lower--.f6456.8

              \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
          5. Applied rewrites56.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites36.8%

              \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
            2. Taylor expanded in x around -inf

              \[\leadsto \mathsf{fma}\left(\frac{1}{-1 \cdot \frac{1 + -1 \cdot \frac{-1 \cdot \frac{{t}^{2}}{x} - t}{x}}{x}}, z, x\right) \]
            3. Step-by-step derivation
              1. Applied rewrites58.5%

                \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{1 - \frac{-\left(\frac{t \cdot t}{x} + t\right)}{x}}{-x}}, z, x\right) \]

              if 1.6999999999999999e-115 < y < 1.2e12

              1. Initial program 99.9%

                \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
              2. Add Preprocessing
              3. Taylor expanded in y around inf

                \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                3. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                4. lower--.f6435.3

                  \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
              5. Applied rewrites35.3%

                \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites24.0%

                  \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
                2. Taylor expanded in x around inf

                  \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{-1 \cdot \frac{t}{x} - 1}{x}}, z, x\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites42.4%

                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(\frac{t}{x}, -1, -1\right)}{x}}, z, x\right) \]
                  2. Taylor expanded in t around -inf

                    \[\leadsto \mathsf{fma}\left(\frac{1}{-1 \cdot \frac{-1 \cdot \frac{\frac{{x}^{2}}{t} - -1 \cdot x}{t} - 1}{t}}, z, x\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites57.7%

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} + 1}{t}}, z, x\right) \]

                    if 1.2e12 < y

                    1. Initial program 92.1%

                      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in y around inf

                      \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                      2. *-commutativeN/A

                        \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                      3. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                      4. lower--.f6484.3

                        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                    5. Applied rewrites84.3%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                    6. Taylor expanded in t around 0

                      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(x \cdot z\right) + t \cdot z\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites84.5%

                        \[\leadsto \mathsf{fma}\left(t, \color{blue}{z}, x - z \cdot x\right) \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification64.5%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{-115}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{-1 - \frac{\frac{t \cdot t}{x} + t}{x}}{x}}, z, x\right)\\ \mathbf{elif}\;y \leq 1200000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} - -1}{t}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 7: 61.8% accurate, 3.2× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.5 \cdot 10^{-268}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right)\\ \mathbf{elif}\;y \leq 10:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} - -1}{t}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (if (<= y 1.5e-268)
                       (fma (/ 1.0 (/ (fma t (/ -1.0 x) -1.0) x)) z x)
                       (if (<= y 10.0)
                         (fma (/ 1.0 (/ (- (/ (+ (/ (* x x) t) x) t) -1.0) t)) z x)
                         (fma t z (- x (* x z))))))
                    double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if (y <= 1.5e-268) {
                    		tmp = fma((1.0 / (fma(t, (-1.0 / x), -1.0) / x)), z, x);
                    	} else if (y <= 10.0) {
                    		tmp = fma((1.0 / ((((((x * x) / t) + x) / t) - -1.0) / t)), z, x);
                    	} else {
                    		tmp = fma(t, z, (x - (x * z)));
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t)
                    	tmp = 0.0
                    	if (y <= 1.5e-268)
                    		tmp = fma(Float64(1.0 / Float64(fma(t, Float64(-1.0 / x), -1.0) / x)), z, x);
                    	elseif (y <= 10.0)
                    		tmp = fma(Float64(1.0 / Float64(Float64(Float64(Float64(Float64(Float64(x * x) / t) + x) / t) - -1.0) / t)), z, x);
                    	else
                    		tmp = fma(t, z, Float64(x - Float64(x * z)));
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_] := If[LessEqual[y, 1.5e-268], N[(N[(1.0 / N[(N[(t * N[(-1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[y, 10.0], N[(N[(1.0 / N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision] / t), $MachinePrecision] - -1.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], N[(t * z + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;y \leq 1.5 \cdot 10^{-268}:\\
                    \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right)\\
                    
                    \mathbf{elif}\;y \leq 10:\\
                    \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} - -1}{t}}, z, x\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if y < 1.4999999999999999e-268

                      1. Initial program 93.2%

                        \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in y around inf

                        \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                        2. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                        3. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                        4. lower--.f6462.0

                          \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                      5. Applied rewrites62.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites42.4%

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
                        2. Taylor expanded in x around inf

                          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{-1 \cdot \frac{t}{x} - 1}{x}}, z, x\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites54.8%

                            \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(\frac{t}{x}, -1, -1\right)}{x}}, z, x\right) \]
                          2. Step-by-step derivation
                            1. Applied rewrites54.8%

                              \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right) \]

                            if 1.4999999999999999e-268 < y < 10

                            1. Initial program 100.0%

                              \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                            2. Add Preprocessing
                            3. Taylor expanded in y around inf

                              \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                              2. *-commutativeN/A

                                \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                              3. lower-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                              4. lower--.f6438.8

                                \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                            5. Applied rewrites38.8%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                            6. Step-by-step derivation
                              1. Applied rewrites20.6%

                                \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
                              2. Taylor expanded in x around inf

                                \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{-1 \cdot \frac{t}{x} - 1}{x}}, z, x\right) \]
                              3. Step-by-step derivation
                                1. Applied rewrites53.7%

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(\frac{t}{x}, -1, -1\right)}{x}}, z, x\right) \]
                                2. Taylor expanded in t around -inf

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{-1 \cdot \frac{-1 \cdot \frac{\frac{{x}^{2}}{t} - -1 \cdot x}{t} - 1}{t}}, z, x\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites56.4%

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} + 1}{t}}, z, x\right) \]

                                  if 10 < y

                                  1. Initial program 92.5%

                                    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in y around inf

                                    \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                  4. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                    2. *-commutativeN/A

                                      \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                    3. lower-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                    4. lower--.f6482.1

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                  5. Applied rewrites82.1%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                  6. Taylor expanded in t around 0

                                    \[\leadsto x + \color{blue}{\left(-1 \cdot \left(x \cdot z\right) + t \cdot z\right)} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites82.3%

                                      \[\leadsto \mathsf{fma}\left(t, \color{blue}{z}, x - z \cdot x\right) \]
                                  8. Recombined 3 regimes into one program.
                                  9. Final simplification61.9%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.5 \cdot 10^{-268}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right)\\ \mathbf{elif}\;y \leq 10:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\frac{\frac{x \cdot x}{t} + x}{t} - -1}{t}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \]
                                  10. Add Preprocessing

                                  Alternative 8: 60.8% accurate, 4.6× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \end{array} \]
                                  (FPCore (x y z t)
                                   :precision binary64
                                   (if (<= y 1.82e-81)
                                     (fma (/ 1.0 (/ (fma t (/ -1.0 x) -1.0) x)) z x)
                                     (fma t z (- x (* x z)))))
                                  double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if (y <= 1.82e-81) {
                                  		tmp = fma((1.0 / (fma(t, (-1.0 / x), -1.0) / x)), z, x);
                                  	} else {
                                  		tmp = fma(t, z, (x - (x * z)));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(x, y, z, t)
                                  	tmp = 0.0
                                  	if (y <= 1.82e-81)
                                  		tmp = fma(Float64(1.0 / Float64(fma(t, Float64(-1.0 / x), -1.0) / x)), z, x);
                                  	else
                                  		tmp = fma(t, z, Float64(x - Float64(x * z)));
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[x_, y_, z_, t_] := If[LessEqual[y, 1.82e-81], N[(N[(1.0 / N[(N[(t * N[(-1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], N[(t * z + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\
                                  \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y < 1.82000000000000007e-81

                                    1. Initial program 95.1%

                                      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in y around inf

                                      \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                    4. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                      2. *-commutativeN/A

                                        \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                      3. lower-fma.f64N/A

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                      4. lower--.f6456.6

                                        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                    5. Applied rewrites56.6%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites37.3%

                                        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
                                      2. Taylor expanded in x around inf

                                        \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{-1 \cdot \frac{t}{x} - 1}{x}}, z, x\right) \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites56.2%

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(\frac{t}{x}, -1, -1\right)}{x}}, z, x\right) \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites56.2%

                                            \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right) \]

                                          if 1.82000000000000007e-81 < y

                                          1. Initial program 94.0%

                                            \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in y around inf

                                            \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                          4. Step-by-step derivation
                                            1. +-commutativeN/A

                                              \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                            2. *-commutativeN/A

                                              \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                            3. lower-fma.f64N/A

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                            4. lower--.f6471.3

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                          5. Applied rewrites71.3%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                          6. Taylor expanded in t around 0

                                            \[\leadsto x + \color{blue}{\left(-1 \cdot \left(x \cdot z\right) + t \cdot z\right)} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites71.3%

                                              \[\leadsto \mathsf{fma}\left(t, \color{blue}{z}, x - z \cdot x\right) \]
                                          8. Recombined 2 regimes into one program.
                                          9. Final simplification60.9%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{-1}{x}, -1\right)}{x}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \]
                                          10. Add Preprocessing

                                          Alternative 9: 61.2% accurate, 6.8× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1200000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{1}{t}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \end{array} \]
                                          (FPCore (x y z t)
                                           :precision binary64
                                           (if (<= y 1200000000000.0)
                                             (fma (/ 1.0 (/ 1.0 t)) z x)
                                             (fma t z (- x (* x z)))))
                                          double code(double x, double y, double z, double t) {
                                          	double tmp;
                                          	if (y <= 1200000000000.0) {
                                          		tmp = fma((1.0 / (1.0 / t)), z, x);
                                          	} else {
                                          		tmp = fma(t, z, (x - (x * z)));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x, y, z, t)
                                          	tmp = 0.0
                                          	if (y <= 1200000000000.0)
                                          		tmp = fma(Float64(1.0 / Float64(1.0 / t)), z, x);
                                          	else
                                          		tmp = fma(t, z, Float64(x - Float64(x * z)));
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x_, y_, z_, t_] := If[LessEqual[y, 1200000000000.0], N[(N[(1.0 / N[(1.0 / t), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], N[(t * z + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;y \leq 1200000000000:\\
                                          \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{1}{t}}, z, x\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if y < 1.2e12

                                            1. Initial program 95.5%

                                              \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in y around inf

                                              \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                            4. Step-by-step derivation
                                              1. +-commutativeN/A

                                                \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                              2. *-commutativeN/A

                                                \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                              3. lower-fma.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                              4. lower--.f6454.1

                                                \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                            5. Applied rewrites54.1%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites35.2%

                                                \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
                                              2. Taylor expanded in t around inf

                                                \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{1}{t}}, z, x\right) \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites56.9%

                                                  \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{1}{t}}, z, x\right) \]

                                                if 1.2e12 < y

                                                1. Initial program 92.1%

                                                  \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in y around inf

                                                  \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                4. Step-by-step derivation
                                                  1. +-commutativeN/A

                                                    \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                  2. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                  3. lower-fma.f64N/A

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                  4. lower--.f6484.3

                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                5. Applied rewrites84.3%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                6. Taylor expanded in t around 0

                                                  \[\leadsto x + \color{blue}{\left(-1 \cdot \left(x \cdot z\right) + t \cdot z\right)} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites84.5%

                                                    \[\leadsto \mathsf{fma}\left(t, \color{blue}{z}, x - z \cdot x\right) \]
                                                8. Recombined 2 regimes into one program.
                                                9. Final simplification63.4%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1200000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{1}{t}}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \]
                                                10. Add Preprocessing

                                                Alternative 10: 62.6% accurate, 11.4× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot z\\ \mathbf{if}\;z \leq -0.011:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 520000000:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                (FPCore (x y z t)
                                                 :precision binary64
                                                 (let* ((t_1 (* (- t x) z)))
                                                   (if (<= z -0.011) t_1 (if (<= z 520000000.0) (fma (- x) z x) t_1))))
                                                double code(double x, double y, double z, double t) {
                                                	double t_1 = (t - x) * z;
                                                	double tmp;
                                                	if (z <= -0.011) {
                                                		tmp = t_1;
                                                	} else if (z <= 520000000.0) {
                                                		tmp = fma(-x, z, x);
                                                	} else {
                                                		tmp = t_1;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(x, y, z, t)
                                                	t_1 = Float64(Float64(t - x) * z)
                                                	tmp = 0.0
                                                	if (z <= -0.011)
                                                		tmp = t_1;
                                                	elseif (z <= 520000000.0)
                                                		tmp = fma(Float64(-x), z, x);
                                                	else
                                                		tmp = t_1;
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -0.011], t$95$1, If[LessEqual[z, 520000000.0], N[((-x) * z + x), $MachinePrecision], t$95$1]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_1 := \left(t - x\right) \cdot z\\
                                                \mathbf{if}\;z \leq -0.011:\\
                                                \;\;\;\;t\_1\\
                                                
                                                \mathbf{elif}\;z \leq 520000000:\\
                                                \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;t\_1\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if z < -0.010999999999999999 or 5.2e8 < z

                                                  1. Initial program 88.8%

                                                    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in y around inf

                                                    \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                  4. Step-by-step derivation
                                                    1. +-commutativeN/A

                                                      \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                    2. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                    3. lower-fma.f64N/A

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                    4. lower--.f6441.7

                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                  5. Applied rewrites41.7%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                  6. Taylor expanded in z around inf

                                                    \[\leadsto z \cdot \color{blue}{\left(t - x\right)} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites41.7%

                                                      \[\leadsto \left(t - x\right) \cdot \color{blue}{z} \]

                                                    if -0.010999999999999999 < z < 5.2e8

                                                    1. Initial program 100.0%

                                                      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in y around inf

                                                      \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                    4. Step-by-step derivation
                                                      1. +-commutativeN/A

                                                        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                      2. *-commutativeN/A

                                                        \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                      3. lower-fma.f64N/A

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                      4. lower--.f6478.3

                                                        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                    5. Applied rewrites78.3%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                    6. Taylor expanded in t around 0

                                                      \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites87.2%

                                                        \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]
                                                    8. Recombined 2 regimes into one program.
                                                    9. Add Preprocessing

                                                    Alternative 11: 58.3% accurate, 11.4× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \end{array} \]
                                                    (FPCore (x y z t)
                                                     :precision binary64
                                                     (if (<= y 1.82e-81) (fma (- x) z x) (fma t z (- x (* x z)))))
                                                    double code(double x, double y, double z, double t) {
                                                    	double tmp;
                                                    	if (y <= 1.82e-81) {
                                                    		tmp = fma(-x, z, x);
                                                    	} else {
                                                    		tmp = fma(t, z, (x - (x * z)));
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    function code(x, y, z, t)
                                                    	tmp = 0.0
                                                    	if (y <= 1.82e-81)
                                                    		tmp = fma(Float64(-x), z, x);
                                                    	else
                                                    		tmp = fma(t, z, Float64(x - Float64(x * z)));
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    code[x_, y_, z_, t_] := If[LessEqual[y, 1.82e-81], N[((-x) * z + x), $MachinePrecision], N[(t * z + N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\
                                                    \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if y < 1.82000000000000007e-81

                                                      1. Initial program 95.1%

                                                        \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in y around inf

                                                        \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                      4. Step-by-step derivation
                                                        1. +-commutativeN/A

                                                          \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                        2. *-commutativeN/A

                                                          \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                        3. lower-fma.f64N/A

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                        4. lower--.f6456.6

                                                          \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                      5. Applied rewrites56.6%

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                      6. Taylor expanded in t around 0

                                                        \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites54.1%

                                                          \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]

                                                        if 1.82000000000000007e-81 < y

                                                        1. Initial program 94.0%

                                                          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in y around inf

                                                          \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                        4. Step-by-step derivation
                                                          1. +-commutativeN/A

                                                            \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                          2. *-commutativeN/A

                                                            \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                          3. lower-fma.f64N/A

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                          4. lower--.f6471.3

                                                            \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                        5. Applied rewrites71.3%

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                        6. Taylor expanded in t around 0

                                                          \[\leadsto x + \color{blue}{\left(-1 \cdot \left(x \cdot z\right) + t \cdot z\right)} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites71.3%

                                                            \[\leadsto \mathsf{fma}\left(t, \color{blue}{z}, x - z \cdot x\right) \]
                                                        8. Recombined 2 regimes into one program.
                                                        9. Final simplification59.4%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\ \end{array} \]
                                                        10. Add Preprocessing

                                                        Alternative 12: 20.7% accurate, 11.9× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-x\right) \cdot z\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{-29}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                        (FPCore (x y z t)
                                                         :precision binary64
                                                         (let* ((t_1 (* (- x) z)))
                                                           (if (<= x -1.35e+48) t_1 (if (<= x 1.75e-29) (* z t) t_1))))
                                                        double code(double x, double y, double z, double t) {
                                                        	double t_1 = -x * z;
                                                        	double tmp;
                                                        	if (x <= -1.35e+48) {
                                                        		tmp = t_1;
                                                        	} else if (x <= 1.75e-29) {
                                                        		tmp = z * t;
                                                        	} else {
                                                        		tmp = t_1;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        real(8) function code(x, y, z, t)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            real(8), intent (in) :: z
                                                            real(8), intent (in) :: t
                                                            real(8) :: t_1
                                                            real(8) :: tmp
                                                            t_1 = -x * z
                                                            if (x <= (-1.35d+48)) then
                                                                tmp = t_1
                                                            else if (x <= 1.75d-29) then
                                                                tmp = z * t
                                                            else
                                                                tmp = t_1
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double x, double y, double z, double t) {
                                                        	double t_1 = -x * z;
                                                        	double tmp;
                                                        	if (x <= -1.35e+48) {
                                                        		tmp = t_1;
                                                        	} else if (x <= 1.75e-29) {
                                                        		tmp = z * t;
                                                        	} else {
                                                        		tmp = t_1;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(x, y, z, t):
                                                        	t_1 = -x * z
                                                        	tmp = 0
                                                        	if x <= -1.35e+48:
                                                        		tmp = t_1
                                                        	elif x <= 1.75e-29:
                                                        		tmp = z * t
                                                        	else:
                                                        		tmp = t_1
                                                        	return tmp
                                                        
                                                        function code(x, y, z, t)
                                                        	t_1 = Float64(Float64(-x) * z)
                                                        	tmp = 0.0
                                                        	if (x <= -1.35e+48)
                                                        		tmp = t_1;
                                                        	elseif (x <= 1.75e-29)
                                                        		tmp = Float64(z * t);
                                                        	else
                                                        		tmp = t_1;
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(x, y, z, t)
                                                        	t_1 = -x * z;
                                                        	tmp = 0.0;
                                                        	if (x <= -1.35e+48)
                                                        		tmp = t_1;
                                                        	elseif (x <= 1.75e-29)
                                                        		tmp = z * t;
                                                        	else
                                                        		tmp = t_1;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) * z), $MachinePrecision]}, If[LessEqual[x, -1.35e+48], t$95$1, If[LessEqual[x, 1.75e-29], N[(z * t), $MachinePrecision], t$95$1]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        t_1 := \left(-x\right) \cdot z\\
                                                        \mathbf{if}\;x \leq -1.35 \cdot 10^{+48}:\\
                                                        \;\;\;\;t\_1\\
                                                        
                                                        \mathbf{elif}\;x \leq 1.75 \cdot 10^{-29}:\\
                                                        \;\;\;\;z \cdot t\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;t\_1\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if x < -1.35000000000000002e48 or 1.7499999999999999e-29 < x

                                                          1. Initial program 97.0%

                                                            \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in y around inf

                                                            \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                          4. Step-by-step derivation
                                                            1. +-commutativeN/A

                                                              \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                            2. *-commutativeN/A

                                                              \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                            3. lower-fma.f64N/A

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                            4. lower--.f6466.5

                                                              \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                          5. Applied rewrites66.5%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites33.9%

                                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\frac{x + t}{\left(x + t\right) \cdot \left(t - x\right)}}, z, x\right) \]
                                                            2. Taylor expanded in z around inf

                                                              \[\leadsto z \cdot \color{blue}{\left(t - x\right)} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites18.2%

                                                                \[\leadsto \left(t - x\right) \cdot \color{blue}{z} \]
                                                              2. Taylor expanded in t around 0

                                                                \[\leadsto \left(-1 \cdot x\right) \cdot z \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites17.6%

                                                                  \[\leadsto \left(-x\right) \cdot z \]

                                                                if -1.35000000000000002e48 < x < 1.7499999999999999e-29

                                                                1. Initial program 92.6%

                                                                  \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                                2. Add Preprocessing
                                                                3. Taylor expanded in y around inf

                                                                  \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                                4. Step-by-step derivation
                                                                  1. +-commutativeN/A

                                                                    \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                                  2. *-commutativeN/A

                                                                    \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                                  3. lower-fma.f64N/A

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                  4. lower--.f6456.1

                                                                    \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                                5. Applied rewrites56.1%

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                6. Taylor expanded in t around inf

                                                                  \[\leadsto t \cdot \color{blue}{z} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites23.6%

                                                                    \[\leadsto t \cdot \color{blue}{z} \]
                                                                8. Recombined 2 regimes into one program.
                                                                9. Final simplification20.7%

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+48}:\\ \;\;\;\;\left(-x\right) \cdot z\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{-29}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(-x\right) \cdot z\\ \end{array} \]
                                                                10. Add Preprocessing

                                                                Alternative 13: 58.4% accurate, 14.9× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \end{array} \end{array} \]
                                                                (FPCore (x y z t)
                                                                 :precision binary64
                                                                 (if (<= y 1.82e-81) (fma (- x) z x) (fma (- t x) z x)))
                                                                double code(double x, double y, double z, double t) {
                                                                	double tmp;
                                                                	if (y <= 1.82e-81) {
                                                                		tmp = fma(-x, z, x);
                                                                	} else {
                                                                		tmp = fma((t - x), z, x);
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                function code(x, y, z, t)
                                                                	tmp = 0.0
                                                                	if (y <= 1.82e-81)
                                                                		tmp = fma(Float64(-x), z, x);
                                                                	else
                                                                		tmp = fma(Float64(t - x), z, x);
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                code[x_, y_, z_, t_] := If[LessEqual[y, 1.82e-81], N[((-x) * z + x), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;y \leq 1.82 \cdot 10^{-81}:\\
                                                                \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if y < 1.82000000000000007e-81

                                                                  1. Initial program 95.1%

                                                                    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in y around inf

                                                                    \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. +-commutativeN/A

                                                                      \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                                    2. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                                    3. lower-fma.f64N/A

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                    4. lower--.f6456.6

                                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                                  5. Applied rewrites56.6%

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                  6. Taylor expanded in t around 0

                                                                    \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites54.1%

                                                                      \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]

                                                                    if 1.82000000000000007e-81 < y

                                                                    1. Initial program 94.0%

                                                                      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in y around inf

                                                                      \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                                    4. Step-by-step derivation
                                                                      1. +-commutativeN/A

                                                                        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                                      2. *-commutativeN/A

                                                                        \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                                      3. lower-fma.f64N/A

                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                      4. lower--.f6471.3

                                                                        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                                    5. Applied rewrites71.3%

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                  8. Recombined 2 regimes into one program.
                                                                  9. Add Preprocessing

                                                                  Alternative 14: 26.5% accurate, 26.6× speedup?

                                                                  \[\begin{array}{l} \\ \left(t - x\right) \cdot z \end{array} \]
                                                                  (FPCore (x y z t) :precision binary64 (* (- t x) z))
                                                                  double code(double x, double y, double z, double t) {
                                                                  	return (t - x) * z;
                                                                  }
                                                                  
                                                                  real(8) function code(x, y, z, t)
                                                                      real(8), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      real(8), intent (in) :: z
                                                                      real(8), intent (in) :: t
                                                                      code = (t - x) * z
                                                                  end function
                                                                  
                                                                  public static double code(double x, double y, double z, double t) {
                                                                  	return (t - x) * z;
                                                                  }
                                                                  
                                                                  def code(x, y, z, t):
                                                                  	return (t - x) * z
                                                                  
                                                                  function code(x, y, z, t)
                                                                  	return Float64(Float64(t - x) * z)
                                                                  end
                                                                  
                                                                  function tmp = code(x, y, z, t)
                                                                  	tmp = (t - x) * z;
                                                                  end
                                                                  
                                                                  code[x_, y_, z_, t_] := N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \left(t - x\right) \cdot z
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Initial program 94.7%

                                                                    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in y around inf

                                                                    \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. +-commutativeN/A

                                                                      \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                                    2. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                                    3. lower-fma.f64N/A

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                    4. lower--.f6461.1

                                                                      \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                                  5. Applied rewrites61.1%

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                  6. Taylor expanded in z around inf

                                                                    \[\leadsto z \cdot \color{blue}{\left(t - x\right)} \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites23.8%

                                                                      \[\leadsto \left(t - x\right) \cdot \color{blue}{z} \]
                                                                    2. Add Preprocessing

                                                                    Alternative 15: 16.9% accurate, 39.8× speedup?

                                                                    \[\begin{array}{l} \\ z \cdot t \end{array} \]
                                                                    (FPCore (x y z t) :precision binary64 (* z t))
                                                                    double code(double x, double y, double z, double t) {
                                                                    	return z * t;
                                                                    }
                                                                    
                                                                    real(8) function code(x, y, z, t)
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        real(8), intent (in) :: z
                                                                        real(8), intent (in) :: t
                                                                        code = z * t
                                                                    end function
                                                                    
                                                                    public static double code(double x, double y, double z, double t) {
                                                                    	return z * t;
                                                                    }
                                                                    
                                                                    def code(x, y, z, t):
                                                                    	return z * t
                                                                    
                                                                    function code(x, y, z, t)
                                                                    	return Float64(z * t)
                                                                    end
                                                                    
                                                                    function tmp = code(x, y, z, t)
                                                                    	tmp = z * t;
                                                                    end
                                                                    
                                                                    code[x_, y_, z_, t_] := N[(z * t), $MachinePrecision]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    z \cdot t
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Initial program 94.7%

                                                                      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in y around inf

                                                                      \[\leadsto \color{blue}{x + z \cdot \left(t - x\right)} \]
                                                                    4. Step-by-step derivation
                                                                      1. +-commutativeN/A

                                                                        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
                                                                      2. *-commutativeN/A

                                                                        \[\leadsto \color{blue}{\left(t - x\right) \cdot z} + x \]
                                                                      3. lower-fma.f64N/A

                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                      4. lower--.f6461.1

                                                                        \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                                                    5. Applied rewrites61.1%

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                                                                    6. Taylor expanded in t around inf

                                                                      \[\leadsto t \cdot \color{blue}{z} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites14.4%

                                                                        \[\leadsto t \cdot \color{blue}{z} \]
                                                                      2. Final simplification14.4%

                                                                        \[\leadsto z \cdot t \]
                                                                      3. Add Preprocessing

                                                                      Developer Target 1: 97.1% accurate, 1.0× speedup?

                                                                      \[\begin{array}{l} \\ x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \end{array} \]
                                                                      (FPCore (x y z t)
                                                                       :precision binary64
                                                                       (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))
                                                                      double code(double x, double y, double z, double t) {
                                                                      	return x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
                                                                      }
                                                                      
                                                                      real(8) function code(x, y, z, t)
                                                                          real(8), intent (in) :: x
                                                                          real(8), intent (in) :: y
                                                                          real(8), intent (in) :: z
                                                                          real(8), intent (in) :: t
                                                                          code = x + (y * (z * (tanh((t / y)) - tanh((x / y)))))
                                                                      end function
                                                                      
                                                                      public static double code(double x, double y, double z, double t) {
                                                                      	return x + (y * (z * (Math.tanh((t / y)) - Math.tanh((x / y)))));
                                                                      }
                                                                      
                                                                      def code(x, y, z, t):
                                                                      	return x + (y * (z * (math.tanh((t / y)) - math.tanh((x / y)))))
                                                                      
                                                                      function code(x, y, z, t)
                                                                      	return Float64(x + Float64(y * Float64(z * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))))))
                                                                      end
                                                                      
                                                                      function tmp = code(x, y, z, t)
                                                                      	tmp = x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
                                                                      end
                                                                      
                                                                      code[x_, y_, z_, t_] := N[(x + N[(y * N[(z * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)
                                                                      \end{array}
                                                                      

                                                                      Reproduce

                                                                      ?
                                                                      herbie shell --seed 2024249 
                                                                      (FPCore (x y z t)
                                                                        :name "SynthBasics:moogVCF from YampaSynth-0.2"
                                                                        :precision binary64
                                                                      
                                                                        :alt
                                                                        (! :herbie-platform default (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))
                                                                      
                                                                        (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))