SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.4% → 96.8%
Time: 14.0s
Alternatives: 10
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 10 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.4% 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: 96.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \tanh \left(\frac{x}{y}\right) \cdot \left(-z\right)\right), y, x\right)
\end{array}
Derivation
  1. Initial program 93.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. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 96.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)
\end{array}
Derivation
  1. Initial program 93.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. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 3: 71.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-129}:\\
\;\;\;\;\frac{1}{\frac{1}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.39999999999999989e-129

    1. Initial program 94.1%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. 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. lower-fma.f64N/A

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x}}} \]
      3. Step-by-step derivation
        1. Applied rewrites64.0%

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

        if 2.39999999999999989e-129 < y

        1. Initial program 92.8%

          \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
        2. Add Preprocessing
        3. Taylor expanded in 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. lower-/.f6481.8

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 68.6% accurate, 1.7× speedup?

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

        1. Initial program 94.5%

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{x}}} \]
          3. Step-by-step derivation
            1. Applied rewrites63.2%

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

            if 1.85e-65 < y

            1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 68.5% accurate, 8.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.15 \cdot 10^{-67}:\\ \;\;\;\;\frac{1}{\frac{1}{x}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= y 2.15e-67) (/ 1.0 (/ 1.0 x)) (fma z (- t x) x)))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= 2.15e-67) {
          		tmp = 1.0 / (1.0 / x);
          	} else {
          		tmp = fma(z, (t - x), x);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (y <= 2.15e-67)
          		tmp = Float64(1.0 / Float64(1.0 / x));
          	else
          		tmp = fma(z, Float64(t - x), x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[y, 2.15e-67], N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 2.15 \cdot 10^{-67}:\\
          \;\;\;\;\frac{1}{\frac{1}{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 < 2.15000000000000013e-67

            1. Initial program 94.5%

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

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

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

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

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

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

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

                \[\leadsto \frac{1}{\frac{1}{\color{blue}{x}}} \]
              3. Step-by-step derivation
                1. Applied rewrites63.5%

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

                if 2.15000000000000013e-67 < y

                1. Initial program 91.8%

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

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

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

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

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

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

              Alternative 6: 62.7% accurate, 11.4× speedup?

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

                1. Initial program 88.6%

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

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

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

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

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

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

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

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

                  if -6.20000000000000056e-11 < z < 48000

                  1. Initial program 99.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. lower-fma.f64N/A

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

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

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

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

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

                  Alternative 7: 20.7% accurate, 11.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{-155}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{-135}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= t -7e-155) (* t z) (if (<= t 3.1e-135) (* z (- x)) (* t z))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (t <= -7e-155) {
                  		tmp = t * z;
                  	} else if (t <= 3.1e-135) {
                  		tmp = z * -x;
                  	} else {
                  		tmp = t * z;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z, t)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8) :: tmp
                      if (t <= (-7d-155)) then
                          tmp = t * z
                      else if (t <= 3.1d-135) then
                          tmp = z * -x
                      else
                          tmp = t * z
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (t <= -7e-155) {
                  		tmp = t * z;
                  	} else if (t <= 3.1e-135) {
                  		tmp = z * -x;
                  	} else {
                  		tmp = t * z;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if t <= -7e-155:
                  		tmp = t * z
                  	elif t <= 3.1e-135:
                  		tmp = z * -x
                  	else:
                  		tmp = t * z
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (t <= -7e-155)
                  		tmp = Float64(t * z);
                  	elseif (t <= 3.1e-135)
                  		tmp = Float64(z * Float64(-x));
                  	else
                  		tmp = Float64(t * z);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if (t <= -7e-155)
                  		tmp = t * z;
                  	elseif (t <= 3.1e-135)
                  		tmp = z * -x;
                  	else
                  		tmp = t * z;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[t, -7e-155], N[(t * z), $MachinePrecision], If[LessEqual[t, 3.1e-135], N[(z * (-x)), $MachinePrecision], N[(t * z), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;t \leq -7 \cdot 10^{-155}:\\
                  \;\;\;\;t \cdot z\\
                  
                  \mathbf{elif}\;t \leq 3.1 \cdot 10^{-135}:\\
                  \;\;\;\;z \cdot \left(-x\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t \cdot z\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if t < -7.00000000000000031e-155 or 3.1000000000000001e-135 < t

                    1. Initial program 95.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 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. lower-fma.f64N/A

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

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

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

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

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

                      if -7.00000000000000031e-155 < t < 3.1000000000000001e-135

                      1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 8: 59.1% accurate, 14.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.85 \cdot 10^{-67}:\\ \;\;\;\;\mathsf{fma}\left(z, -x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
                          (FPCore (x y z t)
                           :precision binary64
                           (if (<= y 1.85e-67) (fma z (- x) x) (fma z (- t x) x)))
                          double code(double x, double y, double z, double t) {
                          	double tmp;
                          	if (y <= 1.85e-67) {
                          		tmp = fma(z, -x, x);
                          	} else {
                          		tmp = fma(z, (t - x), x);
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t)
                          	tmp = 0.0
                          	if (y <= 1.85e-67)
                          		tmp = fma(z, Float64(-x), x);
                          	else
                          		tmp = fma(z, Float64(t - x), x);
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_] := If[LessEqual[y, 1.85e-67], N[(z * (-x) + x), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;y \leq 1.85 \cdot 10^{-67}:\\
                          \;\;\;\;\mathsf{fma}\left(z, -x, 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 < 1.85e-67

                            1. Initial program 94.5%

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

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

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

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

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

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

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

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

                              if 1.85e-67 < y

                              1. Initial program 91.8%

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

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

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

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

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

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

                            Alternative 9: 26.4% accurate, 26.6× speedup?

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

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

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

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

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

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

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

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

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

                              Alternative 10: 17.1% accurate, 39.8× speedup?

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

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

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

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

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

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

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

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

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

                                  \[\leadsto t \cdot z \]
                                3. 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 2024219 
                                (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))))))