SynthBasics:moogVCF from YampaSynth-0.2

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

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

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 8.2 \cdot 10^{+215}:\\
\;\;\;\;\mathsf{fma}\left(y\_m \cdot \left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right), z, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 8.2000000000000007e215

    1. Initial program 96.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. +-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} \]
      2. *-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 \]
      3. 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 \]
      4. accelerator-lowering-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)} \]
      5. *-lowering-*.f64N/A

        \[\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) \]
      6. --lowering--.f64N/A

        \[\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) \]
      7. tanh-lowering-tanh.f64N/A

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

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

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

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

      \[\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 8.2000000000000007e215 < y

    1. Initial program 74.2%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. --lowering--.f6495.2

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

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

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

Alternative 2: 65.9% accurate, 0.5× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := x + \left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot \left(y\_m \cdot z\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (let* ((t_1 (+ x (* (- (tanh (/ t y_m)) (tanh (/ x y_m))) (* y_m z)))))
   (if (<= t_1 (- INFINITY)) (* t z) (if (<= t_1 5e+306) x (* t z)))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double t_1 = x + ((tanh((t / y_m)) - tanh((x / y_m))) * (y_m * z));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t * z;
	} else if (t_1 <= 5e+306) {
		tmp = x;
	} else {
		tmp = t * z;
	}
	return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double t_1 = x + ((Math.tanh((t / y_m)) - Math.tanh((x / y_m))) * (y_m * z));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = t * z;
	} else if (t_1 <= 5e+306) {
		tmp = x;
	} else {
		tmp = t * z;
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	t_1 = x + ((math.tanh((t / y_m)) - math.tanh((x / y_m))) * (y_m * z))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = t * z
	elif t_1 <= 5e+306:
		tmp = x
	else:
		tmp = t * z
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	t_1 = Float64(x + Float64(Float64(tanh(Float64(t / y_m)) - tanh(Float64(x / y_m))) * Float64(y_m * z)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(t * z);
	elseif (t_1 <= 5e+306)
		tmp = x;
	else
		tmp = Float64(t * z);
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	t_1 = x + ((tanh((t / y_m)) - tanh((x / y_m))) * (y_m * z));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = t * z;
	elseif (t_1 <= 5e+306)
		tmp = x;
	else
		tmp = t * z;
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(y$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t * z), $MachinePrecision], If[LessEqual[t$95$1, 5e+306], x, N[(t * z), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
t_1 := x + \left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot \left(y\_m \cdot z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t \cdot z\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))

    1. Initial program 58.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. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. --lowering--.f64100.0

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

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

      \[\leadsto \color{blue}{t \cdot z} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot t} \]
      2. *-lowering-*.f6454.2

        \[\leadsto \color{blue}{z \cdot t} \]
    8. Simplified54.2%

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

    if -inf.0 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 4.99999999999999993e306

    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. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified66.1%

        \[\leadsto \color{blue}{x} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification64.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot \left(y \cdot z\right) \leq -\infty:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;x + \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot \left(y \cdot z\right) \leq 5 \cdot 10^{+306}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 80.1% accurate, 1.6× speedup?

    \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 1.6 \cdot 10^{-97}:\\ \;\;\;\;x\\ \mathbf{elif}\;y\_m \leq 1.35 \cdot 10^{-36}:\\ \;\;\;\;\mathsf{fma}\left(y\_m \cdot \left(\tanh \left(\frac{t}{y\_m}\right) - \frac{x}{y\_m}\right), z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, 1, \tanh \left(\frac{x}{y\_m}\right) \cdot \left(-y\_m\right)\right), z, x\right)\\ \end{array} \end{array} \]
    y_m = (fabs.f64 y)
    (FPCore (x y_m z t)
     :precision binary64
     (if (<= y_m 1.6e-97)
       x
       (if (<= y_m 1.35e-36)
         (fma (* y_m (- (tanh (/ t y_m)) (/ x y_m))) z x)
         (fma (fma t 1.0 (* (tanh (/ x y_m)) (- y_m))) z x))))
    y_m = fabs(y);
    double code(double x, double y_m, double z, double t) {
    	double tmp;
    	if (y_m <= 1.6e-97) {
    		tmp = x;
    	} else if (y_m <= 1.35e-36) {
    		tmp = fma((y_m * (tanh((t / y_m)) - (x / y_m))), z, x);
    	} else {
    		tmp = fma(fma(t, 1.0, (tanh((x / y_m)) * -y_m)), z, x);
    	}
    	return tmp;
    }
    
    y_m = abs(y)
    function code(x, y_m, z, t)
    	tmp = 0.0
    	if (y_m <= 1.6e-97)
    		tmp = x;
    	elseif (y_m <= 1.35e-36)
    		tmp = fma(Float64(y_m * Float64(tanh(Float64(t / y_m)) - Float64(x / y_m))), z, x);
    	else
    		tmp = fma(fma(t, 1.0, Float64(tanh(Float64(x / y_m)) * Float64(-y_m))), 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.6e-97], x, If[LessEqual[y$95$m, 1.35e-36], N[(N[(y$95$m * N[(N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision] - N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(t * 1.0 + N[(N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision] * (-y$95$m)), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]]]
    
    \begin{array}{l}
    y_m = \left|y\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y\_m \leq 1.6 \cdot 10^{-97}:\\
    \;\;\;\;x\\
    
    \mathbf{elif}\;y\_m \leq 1.35 \cdot 10^{-36}:\\
    \;\;\;\;\mathsf{fma}\left(y\_m \cdot \left(\tanh \left(\frac{t}{y\_m}\right) - \frac{x}{y\_m}\right), z, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, 1, \tanh \left(\frac{x}{y\_m}\right) \cdot \left(-y\_m\right)\right), z, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < 1.5999999999999999e-97

      1. Initial program 97.2%

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

        \[\leadsto \color{blue}{x} \]
      4. Step-by-step derivation
        1. Simplified66.5%

          \[\leadsto \color{blue}{x} \]

        if 1.5999999999999999e-97 < y < 1.35000000000000004e-36

        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 x around 0

          \[\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. /-lowering-/.f6485.4

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.35000000000000004e-36 < y

        1. Initial program 86.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. +-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} \]
          2. *-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 \]
          3. 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 \]
          4. accelerator-lowering-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)} \]
          5. *-lowering-*.f64N/A

            \[\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) \]
          6. --lowering--.f64N/A

            \[\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) \]
          7. tanh-lowering-tanh.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\tanh \left(\frac{x}{y}\right)}\right) \cdot y, z, x\right) \]
          10. /-lowering-/.f6492.1

            \[\leadsto \mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \color{blue}{\left(\frac{x}{y}\right)}\right) \cdot y, z, x\right) \]
        4. Applied egg-rr92.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)} \]
        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. /-lowering-/.f6483.7

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t, 1, \left(\mathsf{neg}\left(\color{blue}{\tanh \left(\frac{x}{y}\right)}\right)\right) \cdot y\right), z, x\right) \]
          11. /-lowering-/.f6489.3

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

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

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

      Alternative 4: 80.2% accurate, 1.7× speedup?

      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 4.4 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, 1, \tanh \left(\frac{x}{y\_m}\right) \cdot \left(-y\_m\right)\right), z, x\right)\\ \end{array} \end{array} \]
      y_m = (fabs.f64 y)
      (FPCore (x y_m z t)
       :precision binary64
       (if (<= y_m 4.4e-36) x (fma (fma t 1.0 (* (tanh (/ x y_m)) (- y_m))) z x)))
      y_m = fabs(y);
      double code(double x, double y_m, double z, double t) {
      	double tmp;
      	if (y_m <= 4.4e-36) {
      		tmp = x;
      	} else {
      		tmp = fma(fma(t, 1.0, (tanh((x / y_m)) * -y_m)), z, x);
      	}
      	return tmp;
      }
      
      y_m = abs(y)
      function code(x, y_m, z, t)
      	tmp = 0.0
      	if (y_m <= 4.4e-36)
      		tmp = x;
      	else
      		tmp = fma(fma(t, 1.0, Float64(tanh(Float64(x / y_m)) * Float64(-y_m))), 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.4e-36], x, N[(N[(t * 1.0 + N[(N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision] * (-y$95$m)), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]]
      
      \begin{array}{l}
      y_m = \left|y\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y\_m \leq 4.4 \cdot 10^{-36}:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t, 1, \tanh \left(\frac{x}{y\_m}\right) \cdot \left(-y\_m\right)\right), z, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 4.3999999999999999e-36

        1. Initial program 97.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. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified65.4%

            \[\leadsto \color{blue}{x} \]

          if 4.3999999999999999e-36 < y

          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. Step-by-step derivation
            1. +-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} \]
            2. *-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 \]
            3. 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 \]
            4. accelerator-lowering-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)} \]
            5. *-lowering-*.f64N/A

              \[\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) \]
            6. --lowering--.f64N/A

              \[\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) \]
            7. tanh-lowering-tanh.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\tanh \left(\frac{x}{y}\right)}\right) \cdot y, z, x\right) \]
            10. /-lowering-/.f6492.0

              \[\leadsto \mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \color{blue}{\left(\frac{x}{y}\right)}\right) \cdot y, z, x\right) \]
          4. Applied egg-rr92.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. /-lowering-/.f6483.6

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(t, 1, \left(\mathsf{neg}\left(\color{blue}{\tanh \left(\frac{x}{y}\right)}\right)\right) \cdot y\right), z, x\right) \]
            11. /-lowering-/.f6489.3

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

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

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

        Alternative 5: 77.4% accurate, 14.9× speedup?

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

          1. Initial program 97.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. Taylor expanded in x around inf

            \[\leadsto \color{blue}{x} \]
          4. Step-by-step derivation
            1. Simplified65.4%

              \[\leadsto \color{blue}{x} \]

            if 5.5e-33 < y

            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. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
              3. --lowering--.f6480.7

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

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

          Alternative 6: 70.6% accurate, 18.4× speedup?

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

            1. Initial program 97.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. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x} \]
            4. Step-by-step derivation
              1. Simplified65.4%

                \[\leadsto \color{blue}{x} \]

              if 8.5000000000000003e-32 < y

              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. accelerator-lowering-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
                3. --lowering--.f6480.7

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

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

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

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

              Alternative 7: 60.2% accurate, 239.0× speedup?

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

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

                \[\leadsto \color{blue}{x} \]
              4. Step-by-step derivation
                1. Simplified59.7%

                  \[\leadsto \color{blue}{x} \]
                2. Add Preprocessing

                Developer Target 1: 97.2% 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 2024198 
                (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))))))