SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.5% → 98.0%
Time: 11.2s
Alternatives: 12
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 12 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.5% 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: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 4.5 \cdot 10^{+176}:\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot y\_m, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 4.5e+176)
   (fma (* (- (tanh (/ t y_m)) (tanh (/ x y_m))) y_m) z x)
   (fma (- t x) z x)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 4.5e+176) {
		tmp = fma(((tanh((t / y_m)) - tanh((x / y_m))) * y_m), z, x);
	} else {
		tmp = fma((t - x), z, x);
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 4.5e+176)
		tmp = fma(Float64(Float64(tanh(Float64(t / y_m)) - tanh(Float64(x / y_m))) * y_m), z, x);
	else
		tmp = fma(Float64(t - x), z, x);
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 4.5e+176], N[(N[(N[(N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$95$m), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 4.5 \cdot 10^{+176}:\\
\;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot y\_m, 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 < 4.50000000000000003e176

    1. Initial program 95.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. 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. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y}, z, 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 y, z, x\right)} \]

    if 4.50000000000000003e176 < y

    1. Initial program 69.3%

      \[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--.f64100.0

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

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

Alternative 2: 79.6% accurate, 0.2× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\ t_2 := \tanh \left(\frac{t}{y\_m}\right)\\ t_3 := x - \left(\tanh \left(\frac{x}{y\_m}\right) - t\_2\right) \cdot \left(z \cdot y\_m\right)\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+298}:\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+173}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+83}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y\_m, t\_2, x\right) - z \cdot x\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+304}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (let* ((t_1
         (+
          (*
           (/ 1.0 (/ (+ (/ (fma y_m x (/ (* (* x x) y_m) t)) t) y_m) t))
           (* z y_m))
          x))
        (t_2 (tanh (/ t y_m)))
        (t_3 (- x (* (- (tanh (/ x y_m)) t_2) (* z y_m)))))
   (if (<= t_3 -5e+298)
     (fma (- t x) z x)
     (if (<= t_3 -5e+173)
       t_1
       (if (<= t_3 2e+83)
         (- (fma (* z y_m) t_2 x) (* z x))
         (if (<= t_3 5e+304) t_1 (fma z t (* (- x) z))))))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double t_1 = ((1.0 / (((fma(y_m, x, (((x * x) * y_m) / t)) / t) + y_m) / t)) * (z * y_m)) + x;
	double t_2 = tanh((t / y_m));
	double t_3 = x - ((tanh((x / y_m)) - t_2) * (z * y_m));
	double tmp;
	if (t_3 <= -5e+298) {
		tmp = fma((t - x), z, x);
	} else if (t_3 <= -5e+173) {
		tmp = t_1;
	} else if (t_3 <= 2e+83) {
		tmp = fma((z * y_m), t_2, x) - (z * x);
	} else if (t_3 <= 5e+304) {
		tmp = t_1;
	} else {
		tmp = fma(z, t, (-x * z));
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	t_1 = Float64(Float64(Float64(1.0 / Float64(Float64(Float64(fma(y_m, x, Float64(Float64(Float64(x * x) * y_m) / t)) / t) + y_m) / t)) * Float64(z * y_m)) + x)
	t_2 = tanh(Float64(t / y_m))
	t_3 = Float64(x - Float64(Float64(tanh(Float64(x / y_m)) - t_2) * Float64(z * y_m)))
	tmp = 0.0
	if (t_3 <= -5e+298)
		tmp = fma(Float64(t - x), z, x);
	elseif (t_3 <= -5e+173)
		tmp = t_1;
	elseif (t_3 <= 2e+83)
		tmp = Float64(fma(Float64(z * y_m), t_2, x) - Float64(z * x));
	elseif (t_3 <= 5e+304)
		tmp = t_1;
	else
		tmp = fma(z, t, Float64(Float64(-x) * z));
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(N[(1.0 / N[(N[(N[(N[(y$95$m * x + N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(N[(N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision] - t$95$2), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+298], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t$95$3, -5e+173], t$95$1, If[LessEqual[t$95$3, 2e+83], N[(N[(N[(z * y$95$m), $MachinePrecision] * t$95$2 + x), $MachinePrecision] - N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+304], t$95$1, N[(z * t + N[((-x) * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
t_1 := \frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\
t_2 := \tanh \left(\frac{t}{y\_m}\right)\\
t_3 := x - \left(\tanh \left(\frac{x}{y\_m}\right) - t\_2\right) \cdot \left(z \cdot y\_m\right)\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+298}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y\_m, t\_2, x\right) - z \cdot x\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -5.0000000000000003e298

    1. Initial program 70.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--.f6490.7

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

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

    if -5.0000000000000003e298 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -5.00000000000000034e173 or 2.00000000000000006e83 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 4.9999999999999997e304

    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 x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
      2. lower--.f6443.8

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
    5. Applied rewrites43.8%

      \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
    6. Step-by-step derivation
      1. Applied rewrites43.8%

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{1}{-1 \cdot \color{blue}{\frac{-1 \cdot y + -1 \cdot \frac{x \cdot y + \frac{{x}^{2} \cdot y}{t}}{t}}{t}}} \]
      3. Step-by-step derivation
        1. Applied rewrites86.6%

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

        if -5.00000000000000034e173 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 2.00000000000000006e83

        1. Initial program 98.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 x + \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
          2. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(x + \left(z \cdot y\right) \cdot \tanh \left(\frac{t}{y}\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot x\right)\right)} \]
          5. unsub-negN/A

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

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

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

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

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

            \[\leadsto \left(\color{blue}{\left(y \cdot z\right)} \cdot \tanh \left(\frac{t}{y}\right) + x\right) - z \cdot x \]
          11. lower-fma.f6484.5

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

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

        if 4.9999999999999997e304 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))

        1. Initial program 51.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--.f6499.9

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

          \[\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 rewrites99.9%

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

              \[\leadsto \mathsf{fma}\left(z, t, z \cdot \left(-x\right)\right) \]
          3. Recombined 4 regimes into one program.
          4. Final simplification87.0%

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

          Alternative 3: 78.8% accurate, 0.3× speedup?

          \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \tanh \left(\frac{x}{y\_m}\right)\\ t_2 := \tanh \left(\frac{t}{y\_m}\right)\\ t_3 := x - \left(t\_1 - t\_2\right) \cdot \left(z \cdot y\_m\right)\\ \mathbf{if}\;t\_3 \leq -1 \cdot 10^{+113}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y\_m} - t\_1\right) \cdot y\_m, z, x\right)\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+83}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot y\_m, t\_2, x\right) - z \cdot x\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+304}:\\ \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right)\\ \end{array} \end{array} \]
          y_m = (fabs.f64 y)
          (FPCore (x y_m z t)
           :precision binary64
           (let* ((t_1 (tanh (/ x y_m)))
                  (t_2 (tanh (/ t y_m)))
                  (t_3 (- x (* (- t_1 t_2) (* z y_m)))))
             (if (<= t_3 -1e+113)
               (fma (* (- (/ t y_m) t_1) y_m) z x)
               (if (<= t_3 2e+83)
                 (- (fma (* z y_m) t_2 x) (* z x))
                 (if (<= t_3 5e+304)
                   (+
                    (*
                     (/ 1.0 (/ (+ (/ (fma y_m x (/ (* (* x x) y_m) t)) t) y_m) t))
                     (* z y_m))
                    x)
                   (fma z t (* (- x) z)))))))
          y_m = fabs(y);
          double code(double x, double y_m, double z, double t) {
          	double t_1 = tanh((x / y_m));
          	double t_2 = tanh((t / y_m));
          	double t_3 = x - ((t_1 - t_2) * (z * y_m));
          	double tmp;
          	if (t_3 <= -1e+113) {
          		tmp = fma((((t / y_m) - t_1) * y_m), z, x);
          	} else if (t_3 <= 2e+83) {
          		tmp = fma((z * y_m), t_2, x) - (z * x);
          	} else if (t_3 <= 5e+304) {
          		tmp = ((1.0 / (((fma(y_m, x, (((x * x) * y_m) / t)) / t) + y_m) / t)) * (z * y_m)) + x;
          	} else {
          		tmp = fma(z, t, (-x * z));
          	}
          	return tmp;
          }
          
          y_m = abs(y)
          function code(x, y_m, z, t)
          	t_1 = tanh(Float64(x / y_m))
          	t_2 = tanh(Float64(t / y_m))
          	t_3 = Float64(x - Float64(Float64(t_1 - t_2) * Float64(z * y_m)))
          	tmp = 0.0
          	if (t_3 <= -1e+113)
          		tmp = fma(Float64(Float64(Float64(t / y_m) - t_1) * y_m), z, x);
          	elseif (t_3 <= 2e+83)
          		tmp = Float64(fma(Float64(z * y_m), t_2, x) - Float64(z * x));
          	elseif (t_3 <= 5e+304)
          		tmp = Float64(Float64(Float64(1.0 / Float64(Float64(Float64(fma(y_m, x, Float64(Float64(Float64(x * x) * y_m) / t)) / t) + y_m) / t)) * Float64(z * y_m)) + x);
          	else
          		tmp = fma(z, t, Float64(Float64(-x) * z));
          	end
          	return tmp
          end
          
          y_m = N[Abs[y], $MachinePrecision]
          code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(N[(t$95$1 - t$95$2), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+113], N[(N[(N[(N[(t / y$95$m), $MachinePrecision] - t$95$1), $MachinePrecision] * y$95$m), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t$95$3, 2e+83], N[(N[(N[(z * y$95$m), $MachinePrecision] * t$95$2 + x), $MachinePrecision] - N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+304], N[(N[(N[(1.0 / N[(N[(N[(N[(y$95$m * x + N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(z * t + N[((-x) * z), $MachinePrecision]), $MachinePrecision]]]]]]]
          
          \begin{array}{l}
          y_m = \left|y\right|
          
          \\
          \begin{array}{l}
          t_1 := \tanh \left(\frac{x}{y\_m}\right)\\
          t_2 := \tanh \left(\frac{t}{y\_m}\right)\\
          t_3 := x - \left(t\_1 - t\_2\right) \cdot \left(z \cdot y\_m\right)\\
          \mathbf{if}\;t\_3 \leq -1 \cdot 10^{+113}:\\
          \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y\_m} - t\_1\right) \cdot y\_m, z, x\right)\\
          
          \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+83}:\\
          \;\;\;\;\mathsf{fma}\left(z \cdot y\_m, t\_2, x\right) - z \cdot x\\
          
          \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+304}:\\
          \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(z, t, \left(-x\right) \cdot z\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -1e113

            1. Initial program 91.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. *-commutativeN/A

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, 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 y, z, x\right) \]
            6. Step-by-step derivation
              1. lower-/.f6483.2

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

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

            if -1e113 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 2.00000000000000006e83

            1. Initial program 98.3%

              \[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 x + \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
              2. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(x + \left(z \cdot y\right) \cdot \tanh \left(\frac{t}{y}\right)\right) + \color{blue}{\left(\mathsf{neg}\left(z \cdot x\right)\right)} \]
              5. unsub-negN/A

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

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

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

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

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

                \[\leadsto \left(\color{blue}{\left(y \cdot z\right)} \cdot \tanh \left(\frac{t}{y}\right) + x\right) - z \cdot x \]
              11. lower-fma.f6486.5

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

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

            if 2.00000000000000006e83 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 4.9999999999999997e304

            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 x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

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

                \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
            5. Applied rewrites40.1%

              \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
            6. Step-by-step derivation
              1. Applied rewrites40.1%

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

                \[\leadsto x + \left(y \cdot z\right) \cdot \frac{1}{-1 \cdot \color{blue}{\frac{-1 \cdot y + -1 \cdot \frac{x \cdot y + \frac{{x}^{2} \cdot y}{t}}{t}}{t}}} \]
              3. Step-by-step derivation
                1. Applied rewrites84.8%

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

                if 4.9999999999999997e304 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))

                1. Initial program 51.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--.f6499.9

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

                  \[\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 rewrites99.9%

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

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

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

                  Alternative 4: 79.3% accurate, 1.5× speedup?

                  \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\left(\frac{t}{y\_m} - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot y\_m, z, x\right)\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+72}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+83}:\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y\_m}\right) - \frac{x}{y\_m}\right) \cdot z, y\_m, x\right)\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\ \end{array} \end{array} \]
                  y_m = (fabs.f64 y)
                  (FPCore (x y_m z t)
                   :precision binary64
                   (let* ((t_1 (fma (* (- (/ t y_m) (tanh (/ x y_m))) y_m) z x)))
                     (if (<= x -3.2e+72)
                       t_1
                       (if (<= x 1.7e+83)
                         (fma (* (- (tanh (/ t y_m)) (/ x y_m)) z) y_m x)
                         (if (<= x 1.85e+151)
                           t_1
                           (+
                            (*
                             (/ 1.0 (/ (+ (/ (fma y_m x (/ (* (* x x) y_m) t)) t) y_m) t))
                             (* z y_m))
                            x))))))
                  y_m = fabs(y);
                  double code(double x, double y_m, double z, double t) {
                  	double t_1 = fma((((t / y_m) - tanh((x / y_m))) * y_m), z, x);
                  	double tmp;
                  	if (x <= -3.2e+72) {
                  		tmp = t_1;
                  	} else if (x <= 1.7e+83) {
                  		tmp = fma(((tanh((t / y_m)) - (x / y_m)) * z), y_m, x);
                  	} else if (x <= 1.85e+151) {
                  		tmp = t_1;
                  	} else {
                  		tmp = ((1.0 / (((fma(y_m, x, (((x * x) * y_m) / t)) / t) + y_m) / t)) * (z * y_m)) + x;
                  	}
                  	return tmp;
                  }
                  
                  y_m = abs(y)
                  function code(x, y_m, z, t)
                  	t_1 = fma(Float64(Float64(Float64(t / y_m) - tanh(Float64(x / y_m))) * y_m), z, x)
                  	tmp = 0.0
                  	if (x <= -3.2e+72)
                  		tmp = t_1;
                  	elseif (x <= 1.7e+83)
                  		tmp = fma(Float64(Float64(tanh(Float64(t / y_m)) - Float64(x / y_m)) * z), y_m, x);
                  	elseif (x <= 1.85e+151)
                  		tmp = t_1;
                  	else
                  		tmp = Float64(Float64(Float64(1.0 / Float64(Float64(Float64(fma(y_m, x, Float64(Float64(Float64(x * x) * y_m) / t)) / t) + y_m) / t)) * Float64(z * y_m)) + x);
                  	end
                  	return tmp
                  end
                  
                  y_m = N[Abs[y], $MachinePrecision]
                  code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(t / y$95$m), $MachinePrecision] - N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$95$m), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[x, -3.2e+72], t$95$1, If[LessEqual[x, 1.7e+83], N[(N[(N[(N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision] - N[(x / y$95$m), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y$95$m + x), $MachinePrecision], If[LessEqual[x, 1.85e+151], t$95$1, N[(N[(N[(1.0 / N[(N[(N[(N[(y$95$m * x + N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  y_m = \left|y\right|
                  
                  \\
                  \begin{array}{l}
                  t_1 := \mathsf{fma}\left(\left(\frac{t}{y\_m} - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot y\_m, z, x\right)\\
                  \mathbf{if}\;x \leq -3.2 \cdot 10^{+72}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;x \leq 1.7 \cdot 10^{+83}:\\
                  \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y\_m}\right) - \frac{x}{y\_m}\right) \cdot z, y\_m, x\right)\\
                  
                  \mathbf{elif}\;x \leq 1.85 \cdot 10^{+151}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if x < -3.2000000000000001e72 or 1.6999999999999999e83 < x < 1.8499999999999999e151

                    1. Initial program 97.3%

                      \[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. *-commutativeN/A

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, 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 y, z, x\right) \]
                    6. Step-by-step derivation
                      1. lower-/.f6487.8

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

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

                    if -3.2000000000000001e72 < x < 1.6999999999999999e83

                    1. Initial program 89.3%

                      \[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 x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
                    4. Step-by-step derivation
                      1. lower-/.f6480.8

                        \[\leadsto x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
                    5. Applied rewrites80.8%

                      \[\leadsto x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
                    6. 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) - \frac{x}{y}\right)} \]
                      2. +-commutativeN/A

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

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

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

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

                        \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\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) - \frac{x}{y}\right), y, x\right)} \]
                      8. *-commutativeN/A

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

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

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

                    if 1.8499999999999999e151 < x

                    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 x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                      2. lower--.f6445.9

                        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
                    5. Applied rewrites45.9%

                      \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                    6. Step-by-step derivation
                      1. Applied rewrites45.9%

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

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

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

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

                      Alternative 5: 68.0% accurate, 2.6× speedup?

                      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 2.05 \cdot 10^{-58}:\\ \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\ \mathbf{elif}\;y\_m \leq 2 \cdot 10^{-9}:\\ \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(t \cdot t, \frac{y\_m}{x}, t \cdot y\_m\right)}{-x} - y\_m}{x}} \cdot \left(z \cdot y\_m\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \end{array} \end{array} \]
                      y_m = (fabs.f64 y)
                      (FPCore (x y_m z t)
                       :precision binary64
                       (if (<= y_m 2.05e-58)
                         (+
                          (* (/ 1.0 (/ (+ (/ (fma y_m x (/ (* (* x x) y_m) t)) t) y_m) t)) (* z y_m))
                          x)
                         (if (<= y_m 2e-9)
                           (+
                            (*
                             (/ 1.0 (/ (- (/ (fma (* t t) (/ y_m x) (* t y_m)) (- x)) y_m) x))
                             (* z y_m))
                            x)
                           (fma (- t x) z x))))
                      y_m = fabs(y);
                      double code(double x, double y_m, double z, double t) {
                      	double tmp;
                      	if (y_m <= 2.05e-58) {
                      		tmp = ((1.0 / (((fma(y_m, x, (((x * x) * y_m) / t)) / t) + y_m) / t)) * (z * y_m)) + x;
                      	} else if (y_m <= 2e-9) {
                      		tmp = ((1.0 / (((fma((t * t), (y_m / x), (t * y_m)) / -x) - y_m) / x)) * (z * y_m)) + x;
                      	} else {
                      		tmp = fma((t - x), z, x);
                      	}
                      	return tmp;
                      }
                      
                      y_m = abs(y)
                      function code(x, y_m, z, t)
                      	tmp = 0.0
                      	if (y_m <= 2.05e-58)
                      		tmp = Float64(Float64(Float64(1.0 / Float64(Float64(Float64(fma(y_m, x, Float64(Float64(Float64(x * x) * y_m) / t)) / t) + y_m) / t)) * Float64(z * y_m)) + x);
                      	elseif (y_m <= 2e-9)
                      		tmp = Float64(Float64(Float64(1.0 / Float64(Float64(Float64(fma(Float64(t * t), Float64(y_m / x), Float64(t * y_m)) / Float64(-x)) - y_m) / x)) * Float64(z * y_m)) + x);
                      	else
                      		tmp = fma(Float64(t - x), z, x);
                      	end
                      	return tmp
                      end
                      
                      y_m = N[Abs[y], $MachinePrecision]
                      code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 2.05e-58], N[(N[(N[(1.0 / N[(N[(N[(N[(y$95$m * x + N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y$95$m, 2e-9], N[(N[(N[(1.0 / N[(N[(N[(N[(N[(t * t), $MachinePrecision] * N[(y$95$m / x), $MachinePrecision] + N[(t * y$95$m), $MachinePrecision]), $MachinePrecision] / (-x)), $MachinePrecision] - y$95$m), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      y_m = \left|y\right|
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y\_m \leq 2.05 \cdot 10^{-58}:\\
                      \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\
                      
                      \mathbf{elif}\;y\_m \leq 2 \cdot 10^{-9}:\\
                      \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(t \cdot t, \frac{y\_m}{x}, t \cdot y\_m\right)}{-x} - y\_m}{x}} \cdot \left(z \cdot y\_m\right) + x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if y < 2.05000000000000014e-58

                        1. Initial program 96.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 x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                          2. lower--.f6444.2

                            \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
                        5. Applied rewrites44.2%

                          \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                        6. Step-by-step derivation
                          1. Applied rewrites44.2%

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

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

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

                            if 2.05000000000000014e-58 < y < 2.00000000000000012e-9

                            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 x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

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

                                \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
                            5. Applied rewrites44.1%

                              \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                            6. Step-by-step derivation
                              1. Applied rewrites43.9%

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

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

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

                                if 2.00000000000000012e-9 < y

                                1. Initial program 82.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--.f6483.4

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

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

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

                              Alternative 6: 68.1% accurate, 2.9× speedup?

                              \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 4.2 \cdot 10^{-12}:\\ \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \end{array} \end{array} \]
                              y_m = (fabs.f64 y)
                              (FPCore (x y_m z t)
                               :precision binary64
                               (if (<= y_m 4.2e-12)
                                 (+
                                  (* (/ 1.0 (/ (+ (/ (fma y_m x (/ (* (* x x) y_m) t)) t) y_m) t)) (* z y_m))
                                  x)
                                 (fma (- t x) z x)))
                              y_m = fabs(y);
                              double code(double x, double y_m, double z, double t) {
                              	double tmp;
                              	if (y_m <= 4.2e-12) {
                              		tmp = ((1.0 / (((fma(y_m, x, (((x * x) * y_m) / t)) / t) + y_m) / t)) * (z * y_m)) + x;
                              	} else {
                              		tmp = fma((t - x), z, x);
                              	}
                              	return tmp;
                              }
                              
                              y_m = abs(y)
                              function code(x, y_m, z, t)
                              	tmp = 0.0
                              	if (y_m <= 4.2e-12)
                              		tmp = Float64(Float64(Float64(1.0 / Float64(Float64(Float64(fma(y_m, x, Float64(Float64(Float64(x * x) * y_m) / t)) / t) + y_m) / t)) * Float64(z * y_m)) + x);
                              	else
                              		tmp = fma(Float64(t - x), z, x);
                              	end
                              	return tmp
                              end
                              
                              y_m = N[Abs[y], $MachinePrecision]
                              code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 4.2e-12], N[(N[(N[(1.0 / N[(N[(N[(N[(y$95$m * x + N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * N[(z * y$95$m), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]
                              
                              \begin{array}{l}
                              y_m = \left|y\right|
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;y\_m \leq 4.2 \cdot 10^{-12}:\\
                              \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(y\_m, x, \frac{\left(x \cdot x\right) \cdot y\_m}{t}\right)}{t} + y\_m}{t}} \cdot \left(z \cdot y\_m\right) + x\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if y < 4.19999999999999988e-12

                                1. Initial program 96.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 x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                                  2. lower--.f6444.4

                                    \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
                                5. Applied rewrites44.4%

                                  \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites44.4%

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

                                    \[\leadsto x + \left(y \cdot z\right) \cdot \frac{1}{-1 \cdot \color{blue}{\frac{-1 \cdot y + -1 \cdot \frac{x \cdot y + \frac{{x}^{2} \cdot y}{t}}{t}}{t}}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites64.5%

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

                                    if 4.19999999999999988e-12 < y

                                    1. Initial program 82.3%

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

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

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

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

                                  Alternative 7: 65.5% accurate, 8.2× speedup?

                                  \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 7.2 \cdot 10^{-60}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{x} \cdot x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \end{array} \end{array} \]
                                  y_m = (fabs.f64 y)
                                  (FPCore (x y_m z t)
                                   :precision binary64
                                   (if (<= y_m 7.2e-60) (fma (* (/ t x) x) z x) (fma (- t x) z x)))
                                  y_m = fabs(y);
                                  double code(double x, double y_m, double z, double t) {
                                  	double tmp;
                                  	if (y_m <= 7.2e-60) {
                                  		tmp = fma(((t / x) * x), z, x);
                                  	} else {
                                  		tmp = fma((t - x), z, x);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  y_m = abs(y)
                                  function code(x, y_m, z, t)
                                  	tmp = 0.0
                                  	if (y_m <= 7.2e-60)
                                  		tmp = fma(Float64(Float64(t / x) * x), z, x);
                                  	else
                                  		tmp = fma(Float64(t - x), z, x);
                                  	end
                                  	return tmp
                                  end
                                  
                                  y_m = N[Abs[y], $MachinePrecision]
                                  code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 7.2e-60], N[(N[(N[(t / x), $MachinePrecision] * x), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  y_m = \left|y\right|
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;y\_m \leq 7.2 \cdot 10^{-60}:\\
                                  \;\;\;\;\mathsf{fma}\left(\frac{t}{x} \cdot 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 < 7.2e-60

                                    1. Initial program 96.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--.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 x around inf

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

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

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

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

                                        if 7.2e-60 < y

                                        1. Initial program 84.3%

                                          \[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--.f6477.9

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

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

                                      Alternative 8: 62.7% accurate, 11.4× speedup?

                                      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot z\\ \mathbf{if}\;z \leq -1.55 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.052:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                      y_m = (fabs.f64 y)
                                      (FPCore (x y_m z t)
                                       :precision binary64
                                       (let* ((t_1 (* (- t x) z)))
                                         (if (<= z -1.55e+25) t_1 (if (<= z 0.052) (fma (- x) z x) t_1))))
                                      y_m = fabs(y);
                                      double code(double x, double y_m, double z, double t) {
                                      	double t_1 = (t - x) * z;
                                      	double tmp;
                                      	if (z <= -1.55e+25) {
                                      		tmp = t_1;
                                      	} else if (z <= 0.052) {
                                      		tmp = fma(-x, z, x);
                                      	} else {
                                      		tmp = t_1;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      y_m = abs(y)
                                      function code(x, y_m, z, t)
                                      	t_1 = Float64(Float64(t - x) * z)
                                      	tmp = 0.0
                                      	if (z <= -1.55e+25)
                                      		tmp = t_1;
                                      	elseif (z <= 0.052)
                                      		tmp = fma(Float64(-x), z, x);
                                      	else
                                      		tmp = t_1;
                                      	end
                                      	return tmp
                                      end
                                      
                                      y_m = N[Abs[y], $MachinePrecision]
                                      code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.55e+25], t$95$1, If[LessEqual[z, 0.052], N[((-x) * z + x), $MachinePrecision], t$95$1]]]
                                      
                                      \begin{array}{l}
                                      y_m = \left|y\right|
                                      
                                      \\
                                      \begin{array}{l}
                                      t_1 := \left(t - x\right) \cdot z\\
                                      \mathbf{if}\;z \leq -1.55 \cdot 10^{+25}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{elif}\;z \leq 0.052:\\
                                      \;\;\;\;\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 < -1.5499999999999999e25 or 0.0519999999999999976 < z

                                        1. Initial program 86.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--.f6446.0

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

                                          \[\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 rewrites45.9%

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

                                          if -1.5499999999999999e25 < z < 0.0519999999999999976

                                          1. Initial program 98.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--.f6477.0

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

                                            \[\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 rewrites82.5%

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

                                          Alternative 9: 21.7% accurate, 11.9× speedup?

                                          \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;t \leq -2.35 \cdot 10^{-119}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-113}:\\ \;\;\;\;\left(-x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \end{array} \]
                                          y_m = (fabs.f64 y)
                                          (FPCore (x y_m z t)
                                           :precision binary64
                                           (if (<= t -2.35e-119) (* z t) (if (<= t 4.2e-113) (* (- x) z) (* z t))))
                                          y_m = fabs(y);
                                          double code(double x, double y_m, double z, double t) {
                                          	double tmp;
                                          	if (t <= -2.35e-119) {
                                          		tmp = z * t;
                                          	} else if (t <= 4.2e-113) {
                                          		tmp = -x * z;
                                          	} else {
                                          		tmp = z * t;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          y_m = abs(y)
                                          real(8) function code(x, y_m, z, t)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y_m
                                              real(8), intent (in) :: z
                                              real(8), intent (in) :: t
                                              real(8) :: tmp
                                              if (t <= (-2.35d-119)) then
                                                  tmp = z * t
                                              else if (t <= 4.2d-113) then
                                                  tmp = -x * z
                                              else
                                                  tmp = z * t
                                              end if
                                              code = tmp
                                          end function
                                          
                                          y_m = Math.abs(y);
                                          public static double code(double x, double y_m, double z, double t) {
                                          	double tmp;
                                          	if (t <= -2.35e-119) {
                                          		tmp = z * t;
                                          	} else if (t <= 4.2e-113) {
                                          		tmp = -x * z;
                                          	} else {
                                          		tmp = z * t;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          y_m = math.fabs(y)
                                          def code(x, y_m, z, t):
                                          	tmp = 0
                                          	if t <= -2.35e-119:
                                          		tmp = z * t
                                          	elif t <= 4.2e-113:
                                          		tmp = -x * z
                                          	else:
                                          		tmp = z * t
                                          	return tmp
                                          
                                          y_m = abs(y)
                                          function code(x, y_m, z, t)
                                          	tmp = 0.0
                                          	if (t <= -2.35e-119)
                                          		tmp = Float64(z * t);
                                          	elseif (t <= 4.2e-113)
                                          		tmp = Float64(Float64(-x) * z);
                                          	else
                                          		tmp = Float64(z * t);
                                          	end
                                          	return tmp
                                          end
                                          
                                          y_m = abs(y);
                                          function tmp_2 = code(x, y_m, z, t)
                                          	tmp = 0.0;
                                          	if (t <= -2.35e-119)
                                          		tmp = z * t;
                                          	elseif (t <= 4.2e-113)
                                          		tmp = -x * z;
                                          	else
                                          		tmp = z * t;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          y_m = N[Abs[y], $MachinePrecision]
                                          code[x_, y$95$m_, z_, t_] := If[LessEqual[t, -2.35e-119], N[(z * t), $MachinePrecision], If[LessEqual[t, 4.2e-113], N[((-x) * z), $MachinePrecision], N[(z * t), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          y_m = \left|y\right|
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;t \leq -2.35 \cdot 10^{-119}:\\
                                          \;\;\;\;z \cdot t\\
                                          
                                          \mathbf{elif}\;t \leq 4.2 \cdot 10^{-113}:\\
                                          \;\;\;\;\left(-x\right) \cdot z\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;z \cdot t\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if t < -2.35000000000000001e-119 or 4.2e-113 < t

                                            1. Initial program 93.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--.f6459.8

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

                                              \[\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.1%

                                                \[\leadsto t \cdot \color{blue}{z} \]

                                              if -2.35000000000000001e-119 < t < 4.2e-113

                                              1. Initial program 91.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--.f6470.1

                                                  \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, z, x\right) \]
                                              5. Applied rewrites70.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 rewrites28.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 rewrites24.3%

                                                    \[\leadsto \left(-x\right) \cdot z \]
                                                4. Recombined 2 regimes into one program.
                                                5. Final simplification23.5%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.35 \cdot 10^{-119}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-113}:\\ \;\;\;\;\left(-x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
                                                6. Add Preprocessing

                                                Alternative 10: 65.1% accurate, 14.9× speedup?

                                                \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 1.05 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(-x, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\ \end{array} \end{array} \]
                                                y_m = (fabs.f64 y)
                                                (FPCore (x y_m z t)
                                                 :precision binary64
                                                 (if (<= y_m 1.05e-10) (fma (- x) z x) (fma (- t x) z x)))
                                                y_m = fabs(y);
                                                double code(double x, double y_m, double z, double t) {
                                                	double tmp;
                                                	if (y_m <= 1.05e-10) {
                                                		tmp = fma(-x, z, x);
                                                	} else {
                                                		tmp = fma((t - x), z, x);
                                                	}
                                                	return tmp;
                                                }
                                                
                                                y_m = abs(y)
                                                function code(x, y_m, z, t)
                                                	tmp = 0.0
                                                	if (y_m <= 1.05e-10)
                                                		tmp = fma(Float64(-x), z, x);
                                                	else
                                                		tmp = fma(Float64(t - x), z, x);
                                                	end
                                                	return tmp
                                                end
                                                
                                                y_m = N[Abs[y], $MachinePrecision]
                                                code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 1.05e-10], N[((-x) * z + x), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * z + x), $MachinePrecision]]
                                                
                                                \begin{array}{l}
                                                y_m = \left|y\right|
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;y\_m \leq 1.05 \cdot 10^{-10}:\\
                                                \;\;\;\;\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.05e-10

                                                  1. Initial program 96.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--.f6455.2

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

                                                    \[\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 rewrites53.1%

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

                                                    if 1.05e-10 < y

                                                    1. Initial program 82.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--.f6483.4

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

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

                                                  Alternative 11: 26.9% accurate, 26.6× speedup?

                                                  \[\begin{array}{l} y_m = \left|y\right| \\ \left(t - x\right) \cdot z \end{array} \]
                                                  y_m = (fabs.f64 y)
                                                  (FPCore (x y_m z t) :precision binary64 (* (- t x) z))
                                                  y_m = fabs(y);
                                                  double code(double x, double y_m, double z, double t) {
                                                  	return (t - x) * z;
                                                  }
                                                  
                                                  y_m = abs(y)
                                                  real(8) function code(x, y_m, z, t)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y_m
                                                      real(8), intent (in) :: z
                                                      real(8), intent (in) :: t
                                                      code = (t - x) * z
                                                  end function
                                                  
                                                  y_m = Math.abs(y);
                                                  public static double code(double x, double y_m, double z, double t) {
                                                  	return (t - x) * z;
                                                  }
                                                  
                                                  y_m = math.fabs(y)
                                                  def code(x, y_m, z, t):
                                                  	return (t - x) * z
                                                  
                                                  y_m = abs(y)
                                                  function code(x, y_m, z, t)
                                                  	return Float64(Float64(t - x) * z)
                                                  end
                                                  
                                                  y_m = abs(y);
                                                  function tmp = code(x, y_m, z, t)
                                                  	tmp = (t - x) * z;
                                                  end
                                                  
                                                  y_m = N[Abs[y], $MachinePrecision]
                                                  code[x_, y$95$m_, z_, t_] := N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]
                                                  
                                                  \begin{array}{l}
                                                  y_m = \left|y\right|
                                                  
                                                  \\
                                                  \left(t - x\right) \cdot z
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Initial program 92.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--.f6462.8

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

                                                    \[\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 rewrites27.1%

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

                                                    Alternative 12: 17.4% accurate, 39.8× speedup?

                                                    \[\begin{array}{l} y_m = \left|y\right| \\ z \cdot t \end{array} \]
                                                    y_m = (fabs.f64 y)
                                                    (FPCore (x y_m z t) :precision binary64 (* z t))
                                                    y_m = fabs(y);
                                                    double code(double x, double y_m, double z, double t) {
                                                    	return z * t;
                                                    }
                                                    
                                                    y_m = abs(y)
                                                    real(8) function code(x, y_m, z, t)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y_m
                                                        real(8), intent (in) :: z
                                                        real(8), intent (in) :: t
                                                        code = z * t
                                                    end function
                                                    
                                                    y_m = Math.abs(y);
                                                    public static double code(double x, double y_m, double z, double t) {
                                                    	return z * t;
                                                    }
                                                    
                                                    y_m = math.fabs(y)
                                                    def code(x, y_m, z, t):
                                                    	return z * t
                                                    
                                                    y_m = abs(y)
                                                    function code(x, y_m, z, t)
                                                    	return Float64(z * t)
                                                    end
                                                    
                                                    y_m = abs(y);
                                                    function tmp = code(x, y_m, z, t)
                                                    	tmp = z * t;
                                                    end
                                                    
                                                    y_m = N[Abs[y], $MachinePrecision]
                                                    code[x_, y$95$m_, z_, t_] := N[(z * t), $MachinePrecision]
                                                    
                                                    \begin{array}{l}
                                                    y_m = \left|y\right|
                                                    
                                                    \\
                                                    z \cdot t
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Initial program 92.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--.f6462.8

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

                                                      \[\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 rewrites18.4%

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

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

                                                      Developer Target 1: 97.0% 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 2024270 
                                                      (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))))))