SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.4% → 97.1%
Time: 14.4s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 93.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: 97.1% 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 92.1%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. 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-*.f6497.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 rewrites97.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. Add Preprocessing

Alternative 2: 69.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot \left(z \cdot y\right)\\ t_2 := x + \left(z \cdot y\right) \cdot \frac{1}{\frac{y + \frac{\frac{y \cdot \left(x \cdot x\right)}{t}}{t}}{t}}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \mathbf{elif}\;t\_1 \leq -10000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+30}:\\ \;\;\;\;x + \left(z \cdot y\right) \cdot \frac{1}{\frac{\mathsf{fma}\left(t, \frac{y}{x}, y\right)}{-x}}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+281}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* (- (tanh (/ t y)) (tanh (/ x y))) (* z y))))
        (t_2 (+ x (* (* z y) (/ 1.0 (/ (+ y (/ (/ (* y (* x x)) t) t)) t))))))
   (if (<= t_1 (- INFINITY))
     (* z (- t x))
     (if (<= t_1 -10000000.0)
       t_2
       (if (<= t_1 5e+30)
         (+ x (* (* z y) (/ 1.0 (/ (fma t (/ y x) y) (- x)))))
         (if (<= t_1 2e+281) t_2 (fma z (- t x) x)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + ((tanh((t / y)) - tanh((x / y))) * (z * y));
	double t_2 = x + ((z * y) * (1.0 / ((y + (((y * (x * x)) / t) / t)) / t)));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = z * (t - x);
	} else if (t_1 <= -10000000.0) {
		tmp = t_2;
	} else if (t_1 <= 5e+30) {
		tmp = x + ((z * y) * (1.0 / (fma(t, (y / x), y) / -x)));
	} else if (t_1 <= 2e+281) {
		tmp = t_2;
	} else {
		tmp = fma(z, (t - x), x);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x + Float64(Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))) * Float64(z * y)))
	t_2 = Float64(x + Float64(Float64(z * y) * Float64(1.0 / Float64(Float64(y + Float64(Float64(Float64(y * Float64(x * x)) / t) / t)) / t))))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(z * Float64(t - x));
	elseif (t_1 <= -10000000.0)
		tmp = t_2;
	elseif (t_1 <= 5e+30)
		tmp = Float64(x + Float64(Float64(z * y) * Float64(1.0 / Float64(fma(t, Float64(y / x), y) / Float64(-x)))));
	elseif (t_1 <= 2e+281)
		tmp = t_2;
	else
		tmp = fma(z, Float64(t - x), x);
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(z * y), $MachinePrecision] * N[(1.0 / N[(N[(y + N[(N[(N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -10000000.0], t$95$2, If[LessEqual[t$95$1, 5e+30], N[(x + N[(N[(z * y), $MachinePrecision] * N[(1.0 / N[(N[(t * N[(y / x), $MachinePrecision] + y), $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+281], t$95$2, N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -10000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+30}:\\
\;\;\;\;x + \left(z \cdot y\right) \cdot \frac{1}{\frac{\mathsf{fma}\left(t, \frac{y}{x}, y\right)}{-x}}\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 52.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--.f64100.0

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

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

      if -inf.0 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < -1e7 or 4.9999999999999998e30 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 2.0000000000000001e281

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

            if -1e7 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 4.9999999999999998e30

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

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

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

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

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

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

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

                if 2.0000000000000001e281 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))

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

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

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

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

              Alternative 3: 78.2% accurate, 1.6× speedup?

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

                1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.8000000000000001e33 < t < 2.0500000000000001e-231

                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. 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-*.f6495.4

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

                  \[\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-/.f6491.6

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

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

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

              Alternative 4: 75.6% accurate, 1.7× speedup?

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

                1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

                    if -2.6999999999999998e119 < x

                    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 5: 52.8% accurate, 3.7× speedup?

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

                    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

                        if 2.99999999999999982e-224 < y < 2.20000000000000012e-104

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

                            if 2.20000000000000012e-104 < y

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

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

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

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

                          Alternative 6: 52.0% accurate, 7.0× speedup?

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

                            1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

                                if 6.6e-128 < y

                                1. Initial program 92.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--.f6469.7

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

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

                              Alternative 7: 57.7% accurate, 7.5× speedup?

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

                                1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

                                    if 5.50000000000000016e-124 < y

                                    1. Initial program 92.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--.f6471.3

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

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

                                  Alternative 8: 62.4% accurate, 11.4× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(t - x\right)\\ \mathbf{if}\;z \leq -5500000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-6}:\\ \;\;\;\;\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 -5500000000000.0) t_1 (if (<= z 2.9e-6) (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 <= -5500000000000.0) {
                                  		tmp = t_1;
                                  	} else if (z <= 2.9e-6) {
                                  		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 <= -5500000000000.0)
                                  		tmp = t_1;
                                  	elseif (z <= 2.9e-6)
                                  		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, -5500000000000.0], t$95$1, If[LessEqual[z, 2.9e-6], 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 -5500000000000:\\
                                  \;\;\;\;t\_1\\
                                  
                                  \mathbf{elif}\;z \leq 2.9 \cdot 10^{-6}:\\
                                  \;\;\;\;\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 < -5.5e12 or 2.9000000000000002e-6 < z

                                    1. Initial program 82.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--.f6446.5

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

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

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

                                      if -5.5e12 < z < 2.9000000000000002e-6

                                      1. Initial program 99.3%

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

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

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

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

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

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

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

                                      Alternative 9: 58.7% accurate, 14.9× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.45 \cdot 10^{-102}:\\ \;\;\;\;\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 2.45e-102) (fma z (- x) x) (fma z (- t x) x)))
                                      double code(double x, double y, double z, double t) {
                                      	double tmp;
                                      	if (y <= 2.45e-102) {
                                      		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 <= 2.45e-102)
                                      		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, 2.45e-102], N[(z * (-x) + x), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;y \leq 2.45 \cdot 10^{-102}:\\
                                      \;\;\;\;\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 < 2.4499999999999999e-102

                                        1. Initial program 92.3%

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

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

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

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

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

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

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

                                          if 2.4499999999999999e-102 < y

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

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

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

                                        Alternative 10: 18.5% accurate, 17.1× speedup?

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

                                          1. Initial program 90.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--.f6468.0

                                              \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
                                          5. Applied rewrites68.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 rewrites22.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 rewrites15.9%

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

                                              if -6.2e-155 < x

                                              1. Initial program 93.4%

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

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

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

                                                  \[\leadsto z \cdot \color{blue}{t} \]
                                              8. Recombined 2 regimes into one program.
                                              9. Add Preprocessing

                                              Alternative 11: 26.8% 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 92.1%

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

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

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

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

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

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

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

                                                Alternative 12: 17.2% accurate, 39.8× speedup?

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

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

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

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

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

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

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

                                                    \[\leadsto z \cdot \color{blue}{t} \]
                                                  2. Add Preprocessing

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

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

                                                  Reproduce

                                                  ?
                                                  herbie shell --seed 2024221 
                                                  (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))))))