SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.5% → 97.0%
Time: 13.4s
Alternatives: 9
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 9 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: 97.0% accurate, 1.0× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \tanh \left(\frac{t}{y\_m}\right)\\ \mathbf{if}\;y\_m \leq 7.2 \cdot 10^{+124}:\\ \;\;\;\;x + \left(y\_m \cdot z\right) \cdot \left(t\_1 - \tanh \left(\frac{x}{y\_m}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y\_m \cdot t\_1 - x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (let* ((t_1 (tanh (/ t y_m))))
   (if (<= y_m 7.2e+124)
     (+ x (* (* y_m z) (- t_1 (tanh (/ x y_m)))))
     (+ x (* z (- (* y_m t_1) x))))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double t_1 = tanh((t / y_m));
	double tmp;
	if (y_m <= 7.2e+124) {
		tmp = x + ((y_m * z) * (t_1 - tanh((x / y_m))));
	} else {
		tmp = x + (z * ((y_m * t_1) - x));
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = tanh((t / y_m))
    if (y_m <= 7.2d+124) then
        tmp = x + ((y_m * z) * (t_1 - tanh((x / y_m))))
    else
        tmp = x + (z * ((y_m * t_1) - x))
    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 t_1 = Math.tanh((t / y_m));
	double tmp;
	if (y_m <= 7.2e+124) {
		tmp = x + ((y_m * z) * (t_1 - Math.tanh((x / y_m))));
	} else {
		tmp = x + (z * ((y_m * t_1) - x));
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	t_1 = math.tanh((t / y_m))
	tmp = 0
	if y_m <= 7.2e+124:
		tmp = x + ((y_m * z) * (t_1 - math.tanh((x / y_m))))
	else:
		tmp = x + (z * ((y_m * t_1) - x))
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	t_1 = tanh(Float64(t / y_m))
	tmp = 0.0
	if (y_m <= 7.2e+124)
		tmp = Float64(x + Float64(Float64(y_m * z) * Float64(t_1 - tanh(Float64(x / y_m)))));
	else
		tmp = Float64(x + Float64(z * Float64(Float64(y_m * t_1) - x)));
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	t_1 = tanh((t / y_m));
	tmp = 0.0;
	if (y_m <= 7.2e+124)
		tmp = x + ((y_m * z) * (t_1 - tanh((x / y_m))));
	else
		tmp = x + (z * ((y_m * t_1) - x));
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$95$m, 7.2e+124], N[(x + N[(N[(y$95$m * z), $MachinePrecision] * N[(t$95$1 - N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(y$95$m * t$95$1), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|

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

\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y\_m \cdot t\_1 - x\right)\\


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

    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

    if 7.19999999999999972e124 < y

    1. Initial program 80.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 x around 0 79.2%

      \[\leadsto x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
    4. Taylor expanded in y around 0 55.3%

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

        \[\leadsto x + \color{blue}{\left(y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right) + -1 \cdot \left(x \cdot z\right)\right)} \]
      2. mul-1-neg55.3%

        \[\leadsto x + \left(y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right) + \color{blue}{\left(-x \cdot z\right)}\right) \]
      3. unsub-neg55.3%

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

      \[\leadsto x + \color{blue}{\left(\left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right) - z \cdot x\right)} \]
    7. Taylor expanded in z around 0 55.3%

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

        \[\leadsto x + \color{blue}{z \cdot \left(y \cdot \tanh \left(\frac{t}{y}\right) - x\right)} \]
    9. Recombined 2 regimes into one program.
    10. Add Preprocessing

    Alternative 2: 87.4% accurate, 1.8× speedup?

    \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} t_1 := \tanh \left(\frac{t}{y\_m}\right)\\ \mathbf{if}\;y\_m \leq 2.3 \cdot 10^{+65}:\\ \;\;\;\;x + \left(y\_m \cdot z\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y\_m \cdot t\_1 - x\right)\\ \end{array} \end{array} \]
    y_m = (fabs.f64 y)
    (FPCore (x y_m z t)
     :precision binary64
     (let* ((t_1 (tanh (/ t y_m))))
       (if (<= y_m 2.3e+65)
         (+ x (* (* y_m z) t_1))
         (+ x (* z (- (* y_m t_1) x))))))
    y_m = fabs(y);
    double code(double x, double y_m, double z, double t) {
    	double t_1 = tanh((t / y_m));
    	double tmp;
    	if (y_m <= 2.3e+65) {
    		tmp = x + ((y_m * z) * t_1);
    	} else {
    		tmp = x + (z * ((y_m * t_1) - x));
    	}
    	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) :: t_1
        real(8) :: tmp
        t_1 = tanh((t / y_m))
        if (y_m <= 2.3d+65) then
            tmp = x + ((y_m * z) * t_1)
        else
            tmp = x + (z * ((y_m * t_1) - x))
        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 t_1 = Math.tanh((t / y_m));
    	double tmp;
    	if (y_m <= 2.3e+65) {
    		tmp = x + ((y_m * z) * t_1);
    	} else {
    		tmp = x + (z * ((y_m * t_1) - x));
    	}
    	return tmp;
    }
    
    y_m = math.fabs(y)
    def code(x, y_m, z, t):
    	t_1 = math.tanh((t / y_m))
    	tmp = 0
    	if y_m <= 2.3e+65:
    		tmp = x + ((y_m * z) * t_1)
    	else:
    		tmp = x + (z * ((y_m * t_1) - x))
    	return tmp
    
    y_m = abs(y)
    function code(x, y_m, z, t)
    	t_1 = tanh(Float64(t / y_m))
    	tmp = 0.0
    	if (y_m <= 2.3e+65)
    		tmp = Float64(x + Float64(Float64(y_m * z) * t_1));
    	else
    		tmp = Float64(x + Float64(z * Float64(Float64(y_m * t_1) - x)));
    	end
    	return tmp
    end
    
    y_m = abs(y);
    function tmp_2 = code(x, y_m, z, t)
    	t_1 = tanh((t / y_m));
    	tmp = 0.0;
    	if (y_m <= 2.3e+65)
    		tmp = x + ((y_m * z) * t_1);
    	else
    		tmp = x + (z * ((y_m * t_1) - x));
    	end
    	tmp_2 = tmp;
    end
    
    y_m = N[Abs[y], $MachinePrecision]
    code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$95$m, 2.3e+65], N[(x + N[(N[(y$95$m * z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(y$95$m * t$95$1), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    y_m = \left|y\right|
    
    \\
    \begin{array}{l}
    t_1 := \tanh \left(\frac{t}{y\_m}\right)\\
    \mathbf{if}\;y\_m \leq 2.3 \cdot 10^{+65}:\\
    \;\;\;\;x + \left(y\_m \cdot z\right) \cdot t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;x + z \cdot \left(y\_m \cdot t\_1 - x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 2.3e65

      1. Initial program 96.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 x around 0 24.7%

        \[\leadsto x + \color{blue}{y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right)} \]
      4. Step-by-step derivation
        1. associate-*r*24.6%

          \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)} \]
        2. associate-/r*24.6%

          \[\leadsto x + \left(y \cdot z\right) \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \color{blue}{\frac{\frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}}\right) \]
        3. div-sub24.6%

          \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{e^{\frac{t}{y}} - \frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}} \]
        4. rec-exp24.6%

          \[\leadsto x + \left(y \cdot z\right) \cdot \frac{e^{\frac{t}{y}} - \color{blue}{e^{-\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} \]
        5. rec-exp24.6%

          \[\leadsto x + \left(y \cdot z\right) \cdot \frac{e^{\frac{t}{y}} - e^{-\frac{t}{y}}}{e^{\frac{t}{y}} + \color{blue}{e^{-\frac{t}{y}}}} \]
        6. tanh-def-a86.2%

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

        \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right)} \]

      if 2.3e65 < y

      1. Initial program 87.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 0 83.8%

        \[\leadsto x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
      4. Taylor expanded in y around 0 59.7%

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

          \[\leadsto x + \color{blue}{\left(y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right) + -1 \cdot \left(x \cdot z\right)\right)} \]
        2. mul-1-neg59.7%

          \[\leadsto x + \left(y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right) + \color{blue}{\left(-x \cdot z\right)}\right) \]
        3. unsub-neg59.7%

          \[\leadsto x + \color{blue}{\left(y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right) - x \cdot z\right)} \]
      6. Simplified77.1%

        \[\leadsto x + \color{blue}{\left(\left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right) - z \cdot x\right)} \]
      7. Taylor expanded in z around 0 59.7%

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

          \[\leadsto x + \color{blue}{z \cdot \left(y \cdot \tanh \left(\frac{t}{y}\right) - x\right)} \]
      9. Recombined 2 regimes into one program.
      10. Add Preprocessing

      Alternative 3: 85.0% accurate, 1.9× speedup?

      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 1.2 \cdot 10^{+66}:\\ \;\;\;\;x + \left(y\_m \cdot z\right) \cdot \tanh \left(\frac{t}{y\_m}\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 1.2e+66) (+ x (* (* y_m z) (tanh (/ t y_m)))) (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 <= 1.2e+66) {
      		tmp = x + ((y_m * z) * tanh((t / y_m)));
      	} 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 <= 1.2e+66)
      		tmp = Float64(x + Float64(Float64(y_m * z) * tanh(Float64(t / y_m))));
      	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, 1.2e+66], N[(x + N[(N[(y$95$m * z), $MachinePrecision] * N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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 1.2 \cdot 10^{+66}:\\
      \;\;\;\;x + \left(y\_m \cdot z\right) \cdot \tanh \left(\frac{t}{y\_m}\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 < 1.2000000000000001e66

        1. Initial program 96.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 x around 0 24.7%

          \[\leadsto x + \color{blue}{y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right)} \]
        4. Step-by-step derivation
          1. associate-*r*24.6%

            \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)} \]
          2. associate-/r*24.6%

            \[\leadsto x + \left(y \cdot z\right) \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \color{blue}{\frac{\frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}}\right) \]
          3. div-sub24.6%

            \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{e^{\frac{t}{y}} - \frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}} \]
          4. rec-exp24.6%

            \[\leadsto x + \left(y \cdot z\right) \cdot \frac{e^{\frac{t}{y}} - \color{blue}{e^{-\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} \]
          5. rec-exp24.6%

            \[\leadsto x + \left(y \cdot z\right) \cdot \frac{e^{\frac{t}{y}} - e^{-\frac{t}{y}}}{e^{\frac{t}{y}} + \color{blue}{e^{-\frac{t}{y}}}} \]
          6. tanh-def-a86.2%

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

          \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right)} \]

        if 1.2000000000000001e66 < y

        1. Initial program 87.2%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative87.2%

            \[\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. associate-*l*93.4%

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

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

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

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

            \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
          2. fma-define93.0%

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

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

      Alternative 4: 78.0% accurate, 1.9× speedup?

      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 0.58:\\ \;\;\;\;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 0.58) 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 <= 0.58) {
      		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 <= 0.58)
      		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, 0.58], 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 0.58:\\
      \;\;\;\;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 < 0.57999999999999996

        1. Initial program 96.3%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative96.3%

            \[\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. associate-*l*98.1%

            \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
          3. fma-define98.1%

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

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

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

        if 0.57999999999999996 < y

        1. Initial program 89.9%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative89.9%

            \[\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. associate-*l*94.7%

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

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

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

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

            \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
          2. fma-define84.4%

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

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

      Alternative 5: 78.0% accurate, 17.7× speedup?

      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 0.68:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
      y_m = (fabs.f64 y)
      (FPCore (x y_m z t)
       :precision binary64
       (if (<= y_m 0.68) x (+ x (* z (- t x)))))
      y_m = fabs(y);
      double code(double x, double y_m, double z, double t) {
      	double tmp;
      	if (y_m <= 0.68) {
      		tmp = x;
      	} else {
      		tmp = x + (z * (t - x));
      	}
      	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 (y_m <= 0.68d0) then
              tmp = x
          else
              tmp = x + (z * (t - x))
          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 (y_m <= 0.68) {
      		tmp = x;
      	} else {
      		tmp = x + (z * (t - x));
      	}
      	return tmp;
      }
      
      y_m = math.fabs(y)
      def code(x, y_m, z, t):
      	tmp = 0
      	if y_m <= 0.68:
      		tmp = x
      	else:
      		tmp = x + (z * (t - x))
      	return tmp
      
      y_m = abs(y)
      function code(x, y_m, z, t)
      	tmp = 0.0
      	if (y_m <= 0.68)
      		tmp = x;
      	else
      		tmp = Float64(x + Float64(z * Float64(t - x)));
      	end
      	return tmp
      end
      
      y_m = abs(y);
      function tmp_2 = code(x, y_m, z, t)
      	tmp = 0.0;
      	if (y_m <= 0.68)
      		tmp = x;
      	else
      		tmp = x + (z * (t - x));
      	end
      	tmp_2 = tmp;
      end
      
      y_m = N[Abs[y], $MachinePrecision]
      code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 0.68], x, N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      y_m = \left|y\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y\_m \leq 0.68:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z \cdot \left(t - x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 0.680000000000000049

        1. Initial program 96.3%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative96.3%

            \[\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. associate-*l*98.1%

            \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
          3. fma-define98.1%

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

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

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

        if 0.680000000000000049 < y

        1. Initial program 89.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 84.3%

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

      Alternative 6: 70.9% accurate, 21.3× speedup?

      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 11500000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot t\\ \end{array} \end{array} \]
      y_m = (fabs.f64 y)
      (FPCore (x y_m z t)
       :precision binary64
       (if (<= y_m 11500000000000.0) x (+ x (* z t))))
      y_m = fabs(y);
      double code(double x, double y_m, double z, double t) {
      	double tmp;
      	if (y_m <= 11500000000000.0) {
      		tmp = x;
      	} else {
      		tmp = x + (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 (y_m <= 11500000000000.0d0) then
              tmp = x
          else
              tmp = x + (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 (y_m <= 11500000000000.0) {
      		tmp = x;
      	} else {
      		tmp = x + (z * t);
      	}
      	return tmp;
      }
      
      y_m = math.fabs(y)
      def code(x, y_m, z, t):
      	tmp = 0
      	if y_m <= 11500000000000.0:
      		tmp = x
      	else:
      		tmp = x + (z * t)
      	return tmp
      
      y_m = abs(y)
      function code(x, y_m, z, t)
      	tmp = 0.0
      	if (y_m <= 11500000000000.0)
      		tmp = x;
      	else
      		tmp = Float64(x + Float64(z * t));
      	end
      	return tmp
      end
      
      y_m = abs(y);
      function tmp_2 = code(x, y_m, z, t)
      	tmp = 0.0;
      	if (y_m <= 11500000000000.0)
      		tmp = x;
      	else
      		tmp = x + (z * t);
      	end
      	tmp_2 = tmp;
      end
      
      y_m = N[Abs[y], $MachinePrecision]
      code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 11500000000000.0], x, N[(x + N[(z * t), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      y_m = \left|y\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y\_m \leq 11500000000000:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z \cdot t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 1.15e13

        1. Initial program 96.4%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative96.4%

            \[\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. associate-*l*98.1%

            \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
          3. fma-define98.2%

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

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

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

        if 1.15e13 < y

        1. Initial program 89.5%

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

          \[\leadsto x + \color{blue}{y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right)} \]
        4. Step-by-step derivation
          1. associate-*r*34.7%

            \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)} \]
          2. associate-/r*34.7%

            \[\leadsto x + \left(y \cdot z\right) \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \color{blue}{\frac{\frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}}\right) \]
          3. div-sub34.6%

            \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{e^{\frac{t}{y}} - \frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}} \]
          4. rec-exp34.6%

            \[\leadsto x + \left(y \cdot z\right) \cdot \frac{e^{\frac{t}{y}} - \color{blue}{e^{-\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} \]
          5. rec-exp34.6%

            \[\leadsto x + \left(y \cdot z\right) \cdot \frac{e^{\frac{t}{y}} - e^{-\frac{t}{y}}}{e^{\frac{t}{y}} + \color{blue}{e^{-\frac{t}{y}}}} \]
          6. tanh-def-a72.3%

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

          \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right)} \]
        6. Taylor expanded in y around inf 65.9%

          \[\leadsto \color{blue}{x + t \cdot z} \]
        7. Step-by-step derivation
          1. +-commutative65.9%

            \[\leadsto \color{blue}{t \cdot z + x} \]
          2. *-commutative65.9%

            \[\leadsto \color{blue}{z \cdot t} + x \]
        8. Simplified65.9%

          \[\leadsto \color{blue}{z \cdot t + x} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification64.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 11500000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot t\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 67.5% accurate, 21.3× speedup?

      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 165:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \end{array} \end{array} \]
      y_m = (fabs.f64 y)
      (FPCore (x y_m z t) :precision binary64 (if (<= y_m 165.0) x (* x (- 1.0 z))))
      y_m = fabs(y);
      double code(double x, double y_m, double z, double t) {
      	double tmp;
      	if (y_m <= 165.0) {
      		tmp = x;
      	} else {
      		tmp = x * (1.0 - z);
      	}
      	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 (y_m <= 165.0d0) then
              tmp = x
          else
              tmp = x * (1.0d0 - z)
          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 (y_m <= 165.0) {
      		tmp = x;
      	} else {
      		tmp = x * (1.0 - z);
      	}
      	return tmp;
      }
      
      y_m = math.fabs(y)
      def code(x, y_m, z, t):
      	tmp = 0
      	if y_m <= 165.0:
      		tmp = x
      	else:
      		tmp = x * (1.0 - z)
      	return tmp
      
      y_m = abs(y)
      function code(x, y_m, z, t)
      	tmp = 0.0
      	if (y_m <= 165.0)
      		tmp = x;
      	else
      		tmp = Float64(x * Float64(1.0 - z));
      	end
      	return tmp
      end
      
      y_m = abs(y);
      function tmp_2 = code(x, y_m, z, t)
      	tmp = 0.0;
      	if (y_m <= 165.0)
      		tmp = x;
      	else
      		tmp = x * (1.0 - z);
      	end
      	tmp_2 = tmp;
      end
      
      y_m = N[Abs[y], $MachinePrecision]
      code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 165.0], x, N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      y_m = \left|y\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y\_m \leq 165:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \left(1 - z\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 165

        1. Initial program 96.3%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative96.3%

            \[\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. associate-*l*98.1%

            \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
          3. fma-define98.1%

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

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

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

        if 165 < y

        1. Initial program 89.8%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative89.8%

            \[\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. associate-*l*94.7%

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

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

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

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

          \[\leadsto \color{blue}{x + -1 \cdot \left(x \cdot z\right)} \]
        7. Step-by-step derivation
          1. *-lft-identity61.7%

            \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot z\right) \]
          2. mul-1-neg61.7%

            \[\leadsto 1 \cdot x + \color{blue}{\left(-x \cdot z\right)} \]
          3. *-commutative61.7%

            \[\leadsto 1 \cdot x + \left(-\color{blue}{z \cdot x}\right) \]
          4. distribute-lft-neg-in61.7%

            \[\leadsto 1 \cdot x + \color{blue}{\left(-z\right) \cdot x} \]
          5. mul-1-neg61.7%

            \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot z\right)} \cdot x \]
          6. distribute-rgt-in61.7%

            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot z\right)} \]
          7. mul-1-neg61.7%

            \[\leadsto x \cdot \left(1 + \color{blue}{\left(-z\right)}\right) \]
          8. unsub-neg61.7%

            \[\leadsto x \cdot \color{blue}{\left(1 - z\right)} \]
        8. Simplified61.7%

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

      Alternative 8: 60.9% accurate, 23.6× speedup?

      \[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;z \leq 1.3 \cdot 10^{+225}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-z\right)\\ \end{array} \end{array} \]
      y_m = (fabs.f64 y)
      (FPCore (x y_m z t) :precision binary64 (if (<= z 1.3e+225) x (* x (- z))))
      y_m = fabs(y);
      double code(double x, double y_m, double z, double t) {
      	double tmp;
      	if (z <= 1.3e+225) {
      		tmp = x;
      	} else {
      		tmp = x * -z;
      	}
      	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 (z <= 1.3d+225) then
              tmp = x
          else
              tmp = x * -z
          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 (z <= 1.3e+225) {
      		tmp = x;
      	} else {
      		tmp = x * -z;
      	}
      	return tmp;
      }
      
      y_m = math.fabs(y)
      def code(x, y_m, z, t):
      	tmp = 0
      	if z <= 1.3e+225:
      		tmp = x
      	else:
      		tmp = x * -z
      	return tmp
      
      y_m = abs(y)
      function code(x, y_m, z, t)
      	tmp = 0.0
      	if (z <= 1.3e+225)
      		tmp = x;
      	else
      		tmp = Float64(x * Float64(-z));
      	end
      	return tmp
      end
      
      y_m = abs(y);
      function tmp_2 = code(x, y_m, z, t)
      	tmp = 0.0;
      	if (z <= 1.3e+225)
      		tmp = x;
      	else
      		tmp = x * -z;
      	end
      	tmp_2 = tmp;
      end
      
      y_m = N[Abs[y], $MachinePrecision]
      code[x_, y$95$m_, z_, t_] := If[LessEqual[z, 1.3e+225], x, N[(x * (-z)), $MachinePrecision]]
      
      \begin{array}{l}
      y_m = \left|y\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq 1.3 \cdot 10^{+225}:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \left(-z\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < 1.30000000000000002e225

        1. Initial program 94.7%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative94.7%

            \[\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. associate-*l*97.3%

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

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

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

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

        if 1.30000000000000002e225 < z

        1. Initial program 91.2%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Step-by-step derivation
          1. +-commutative91.2%

            \[\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. associate-*l*95.4%

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

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

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

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

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

            \[\leadsto \color{blue}{1 \cdot x} + -1 \cdot \left(x \cdot z\right) \]
          2. mul-1-neg34.5%

            \[\leadsto 1 \cdot x + \color{blue}{\left(-x \cdot z\right)} \]
          3. *-commutative34.5%

            \[\leadsto 1 \cdot x + \left(-\color{blue}{z \cdot x}\right) \]
          4. distribute-lft-neg-in34.5%

            \[\leadsto 1 \cdot x + \color{blue}{\left(-z\right) \cdot x} \]
          5. mul-1-neg34.5%

            \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot z\right)} \cdot x \]
          6. distribute-rgt-in34.5%

            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot z\right)} \]
          7. mul-1-neg34.5%

            \[\leadsto x \cdot \left(1 + \color{blue}{\left(-z\right)}\right) \]
          8. unsub-neg34.5%

            \[\leadsto x \cdot \color{blue}{\left(1 - z\right)} \]
        8. Simplified34.5%

          \[\leadsto \color{blue}{x \cdot \left(1 - z\right)} \]
        9. Taylor expanded in z around inf 34.5%

          \[\leadsto \color{blue}{-1 \cdot \left(x \cdot z\right)} \]
        10. Step-by-step derivation
          1. neg-mul-134.5%

            \[\leadsto \color{blue}{-x \cdot z} \]
          2. distribute-rgt-neg-in34.5%

            \[\leadsto \color{blue}{x \cdot \left(-z\right)} \]
        11. Simplified34.5%

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

      Alternative 9: 60.8% accurate, 213.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. Step-by-step derivation
        1. +-commutative94.4%

          \[\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. associate-*l*97.1%

          \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
        3. fma-define97.1%

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

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

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

      Developer Target 1: 96.8% 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 2024157 
      (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))))))