SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.6% → 96.4%
Time: 9.3s
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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 96.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 98.7%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing

    if 1.00000000000000007e294 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))

    1. Initial program 28.1%

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

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

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

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

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

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

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

Alternative 2: 97.6% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

    if 1.4499999999999999e227 < y

    1. Initial program 67.9%

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

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

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

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

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

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

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

Alternative 3: 77.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right), z \cdot y, x\right)\\ \mathbf{if}\;x \leq -2 \cdot 10^{+90}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.75 \cdot 10^{-56}:\\ \;\;\;\;x + \frac{\left(-z\right) \cdot \left(x \cdot x\right)}{\left(x + t\right) \cdot \left(x - t\right)} \cdot \left(x - t\right)\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+48}:\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (fma (- (/ t y) (tanh (/ x y))) (* z y) x)))
   (if (<= x -2e+90)
     t_1
     (if (<= x -1.75e-56)
       (+ x (* (/ (* (- z) (* x x)) (* (+ x t) (- x t))) (- x t)))
       (if (<= x 3.4e+48) (fma (* (- (tanh (/ t y)) (/ x y)) z) y x) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = fma(((t / y) - tanh((x / y))), (z * y), x);
	double tmp;
	if (x <= -2e+90) {
		tmp = t_1;
	} else if (x <= -1.75e-56) {
		tmp = x + (((-z * (x * x)) / ((x + t) * (x - t))) * (x - t));
	} else if (x <= 3.4e+48) {
		tmp = fma(((tanh((t / y)) - (x / y)) * z), y, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = fma(Float64(Float64(t / y) - tanh(Float64(x / y))), Float64(z * y), x)
	tmp = 0.0
	if (x <= -2e+90)
		tmp = t_1;
	elseif (x <= -1.75e-56)
		tmp = Float64(x + Float64(Float64(Float64(Float64(-z) * Float64(x * x)) / Float64(Float64(x + t) * Float64(x - t))) * Float64(x - t)));
	elseif (x <= 3.4e+48)
		tmp = fma(Float64(Float64(tanh(Float64(t / y)) - Float64(x / y)) * z), y, x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[x, -2e+90], t$95$1, If[LessEqual[x, -1.75e-56], N[(x + N[(N[(N[((-z) * N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e+48], N[(N[(N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[(x / y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right), z \cdot y, x\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.75 \cdot 10^{-56}:\\
\;\;\;\;x + \frac{\left(-z\right) \cdot \left(x \cdot x\right)}{\left(x + t\right) \cdot \left(x - t\right)} \cdot \left(x - t\right)\\

\mathbf{elif}\;x \leq 3.4 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot z, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.99999999999999993e90 or 3.4000000000000003e48 < x

    1. Initial program 99.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 \left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right) \]
    4. Step-by-step derivation
      1. lower-/.f6475.3

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999993e90 < x < -1.7499999999999999e-56

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

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

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
      3. lower--.f6465.1

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

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

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

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

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

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

          if -1.7499999999999999e-56 < x < 3.4000000000000003e48

          1. Initial program 91.4%

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

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

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

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

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

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

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

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

        Alternative 4: 74.2% accurate, 1.5× speedup?

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

          1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

              if -3.50000000000000001e91 < x < -1.7499999999999999e-56

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

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

                  \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                3. lower--.f6465.1

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

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

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

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

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

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

                    if -1.7499999999999999e-56 < x < 5.5999999999999996e50

                    1. Initial program 91.4%

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

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

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

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

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

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

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

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

                  Alternative 5: 56.5% accurate, 6.6× speedup?

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

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

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

                        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                      3. lower--.f6453.9

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

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

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

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

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

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

                          if 7.0000000000000002e-59 < y < 2.2999999999999999e84

                          1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 2.2999999999999999e84 < y

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

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

                                \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                              3. lower--.f6488.7

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

                              \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                          8. Recombined 3 regimes into one program.
                          9. Final simplification61.1%

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

                          Alternative 6: 52.1% accurate, 6.6× speedup?

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

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

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

                                \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                              3. lower--.f6453.9

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

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

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

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

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

                                if 6.50000000000000017e-59 < y < 2.2999999999999999e84

                                1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 2.2999999999999999e84 < y

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

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

                                      \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                    3. lower--.f6488.7

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

                                    \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                8. Recombined 3 regimes into one program.
                                9. Final simplification57.4%

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

                                Alternative 7: 59.2% accurate, 6.8× speedup?

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

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

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

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

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

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

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

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

                                    if 7.0000000000000002e-59 < y < 2.2999999999999999e84

                                    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 2.2999999999999999e84 < y

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

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

                                          \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                        3. lower--.f6488.7

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

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

                                    Alternative 8: 58.9% accurate, 6.8× speedup?

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

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

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

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

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

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

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

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

                                        if 7.0000000000000002e-59 < y < 1.0999999999999999e84

                                        1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

                                            if 1.0999999999999999e84 < y

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

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

                                                \[\leadsto x + \color{blue}{\left(t - x\right) \cdot z} \]
                                              3. lower--.f6488.7

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

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

                                          Alternative 9: 59.2% accurate, 13.3× speedup?

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

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

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

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

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

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

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

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

                                              if 1.8e-75 < y

                                              1. Initial program 89.0%

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

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

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

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

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

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

                                            Alternative 10: 59.2% accurate, 14.9× speedup?

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

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

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

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

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

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

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

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

                                                if 1.8e-75 < y

                                                1. Initial program 89.0%

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

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

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

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

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

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

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

                                              Alternative 11: 53.5% accurate, 26.6× speedup?

                                              \[\begin{array}{l} \\ \mathsf{fma}\left(-x, z, x\right) \end{array} \]
                                              (FPCore (x y z t) :precision binary64 (fma (- x) z x))
                                              double code(double x, double y, double z, double t) {
                                              	return fma(-x, z, x);
                                              }
                                              
                                              function code(x, y, z, t)
                                              	return fma(Float64(-x), z, x)
                                              end
                                              
                                              code[x_, y_, z_, t_] := N[((-x) * z + x), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \mathsf{fma}\left(-x, z, x\right)
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 93.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. *-commutativeN/A

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

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

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

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

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

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

                                                Alternative 12: 17.3% 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 93.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. *-commutativeN/A

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

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

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

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

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

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

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

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

                                                  Reproduce

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