SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.2% → 98.4%
Time: 11.2s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 93.2% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 0.7× speedup?

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

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


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

    1. Initial program 96.7%

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

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

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

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

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

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

    if 5.9000000000000001e184 < y

    1. Initial program 62.8%

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

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

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

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

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

Alternative 2: 97.6% accurate, 1.0× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 8.8 \cdot 10^{+151}:\\ \;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (if (<= y 8.8e+151)
   (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))
   (+ x (* z (- t x)))))
y = abs(y);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 8.8e+151) {
		tmp = x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 8.8d+151) then
        tmp = x + (y * (z * (tanh((t / y)) - tanh((x / y)))))
    else
        tmp = x + (z * (t - x))
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 8.8e+151) {
		tmp = x + (y * (z * (Math.tanh((t / y)) - Math.tanh((x / y)))));
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
y = abs(y)
def code(x, y, z, t):
	tmp = 0
	if y <= 8.8e+151:
		tmp = x + (y * (z * (math.tanh((t / y)) - math.tanh((x / y)))))
	else:
		tmp = x + (z * (t - x))
	return tmp
y = abs(y)
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 8.8e+151)
		tmp = Float64(x + Float64(y * Float64(z * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))))));
	else
		tmp = Float64(x + Float64(z * Float64(t - x)));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 8.8e+151)
		tmp = x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
	else
		tmp = x + (z * (t - x));
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := If[LessEqual[y, 8.8e+151], 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], N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.8 \cdot 10^{+151}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\

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


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

    1. Initial program 97.3%

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

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

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

    if 8.80000000000000027e151 < y

    1. Initial program 62.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.8 \cdot 10^{+151}:\\ \;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \]

Alternative 3: 85.6% accurate, 1.9× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.2 \cdot 10^{+111}:\\ \;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (if (<= y 1.2e+111) (+ x (* (tanh (/ t y)) (* y z))) (+ x (* z (- t x)))))
y = abs(y);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 1.2e+111) {
		tmp = x + (tanh((t / y)) * (y * z));
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 1.2d+111) then
        tmp = x + (tanh((t / y)) * (y * z))
    else
        tmp = x + (z * (t - x))
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 1.2e+111) {
		tmp = x + (Math.tanh((t / y)) * (y * z));
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
y = abs(y)
def code(x, y, z, t):
	tmp = 0
	if y <= 1.2e+111:
		tmp = x + (math.tanh((t / y)) * (y * z))
	else:
		tmp = x + (z * (t - x))
	return tmp
y = abs(y)
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 1.2e+111)
		tmp = Float64(x + Float64(tanh(Float64(t / y)) * Float64(y * z)));
	else
		tmp = Float64(x + Float64(z * Float64(t - x)));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 1.2e+111)
		tmp = x + (tanh((t / y)) * (y * z));
	else
		tmp = x + (z * (t - x));
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := If[LessEqual[y, 1.2e+111], N[(x + N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{+111}:\\
\;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(y \cdot z\right)\\

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

    if 1.20000000000000003e111 < y

    1. Initial program 66.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.2 \cdot 10^{+111}:\\ \;\;\;\;x + \tanh \left(\frac{t}{y}\right) \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \]

Alternative 4: 69.2% accurate, 23.3× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 6.8 \cdot 10^{+68}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+214}:\\ \;\;\;\;x + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (if (<= y 6.8e+68) x (if (<= y 1.85e+214) (+ x (* z t)) (* z (- t x)))))
y = abs(y);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 6.8e+68) {
		tmp = x;
	} else if (y <= 1.85e+214) {
		tmp = x + (z * t);
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 6.8d+68) then
        tmp = x
    else if (y <= 1.85d+214) then
        tmp = x + (z * t)
    else
        tmp = z * (t - x)
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 6.8e+68) {
		tmp = x;
	} else if (y <= 1.85e+214) {
		tmp = x + (z * t);
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
y = abs(y)
def code(x, y, z, t):
	tmp = 0
	if y <= 6.8e+68:
		tmp = x
	elif y <= 1.85e+214:
		tmp = x + (z * t)
	else:
		tmp = z * (t - x)
	return tmp
y = abs(y)
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 6.8e+68)
		tmp = x;
	elseif (y <= 1.85e+214)
		tmp = Float64(x + Float64(z * t));
	else
		tmp = Float64(z * Float64(t - x));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 6.8e+68)
		tmp = x;
	elseif (y <= 1.85e+214)
		tmp = x + (z * t);
	else
		tmp = z * (t - x);
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := If[LessEqual[y, 6.8e+68], x, If[LessEqual[y, 1.85e+214], N[(x + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{+68}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{+214}:\\
\;\;\;\;x + z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 6.8000000000000003e68

    1. Initial program 98.0%

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

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

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

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

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

    if 6.8000000000000003e68 < y < 1.8499999999999999e214

    1. Initial program 80.8%

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

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

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

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

    if 1.8499999999999999e214 < y

    1. Initial program 55.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.8 \cdot 10^{+68}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+214}:\\ \;\;\;\;x + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \]

Alternative 5: 78.0% accurate, 23.5× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{+68}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t)
 :precision binary64
 (if (<= y 6.2e+68) x (+ x (* z (- t x)))))
y = abs(y);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 6.2e+68) {
		tmp = x;
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 6.2d+68) then
        tmp = x
    else
        tmp = x + (z * (t - x))
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 6.2e+68) {
		tmp = x;
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
y = abs(y)
def code(x, y, z, t):
	tmp = 0
	if y <= 6.2e+68:
		tmp = x
	else:
		tmp = x + (z * (t - x))
	return tmp
y = abs(y)
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 6.2e+68)
		tmp = x;
	else
		tmp = Float64(x + Float64(z * Float64(t - x)));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 6.2e+68)
		tmp = x;
	else
		tmp = x + (z * (t - x));
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := If[LessEqual[y, 6.2e+68], x, N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+68}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.0%

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

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

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

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

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

    if 6.1999999999999997e68 < y

    1. Initial program 71.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{+68}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \]

Alternative 6: 64.8% accurate, 30.2× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+142}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t) :precision binary64 (if (<= y 8.5e+142) x (* z (- t x))))
y = abs(y);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 8.5e+142) {
		tmp = x;
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 8.5d+142) then
        tmp = x
    else
        tmp = z * (t - x)
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 8.5e+142) {
		tmp = x;
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
y = abs(y)
def code(x, y, z, t):
	tmp = 0
	if y <= 8.5e+142:
		tmp = x
	else:
		tmp = z * (t - x)
	return tmp
y = abs(y)
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 8.5e+142)
		tmp = x;
	else
		tmp = Float64(z * Float64(t - x));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 8.5e+142)
		tmp = x;
	else
		tmp = z * (t - x);
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := If[LessEqual[y, 8.5e+142], x, N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+142}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.3%

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

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

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

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

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

    if 8.49999999999999955e142 < y

    1. Initial program 65.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+142}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \]

Alternative 7: 59.0% accurate, 35.1× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 7.2 \cdot 10^{+214}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t) :precision binary64 (if (<= y 7.2e+214) x (* z (- x))))
y = abs(y);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 7.2e+214) {
		tmp = x;
	} else {
		tmp = z * -x;
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 7.2d+214) then
        tmp = x
    else
        tmp = z * -x
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 7.2e+214) {
		tmp = x;
	} else {
		tmp = z * -x;
	}
	return tmp;
}
y = abs(y)
def code(x, y, z, t):
	tmp = 0
	if y <= 7.2e+214:
		tmp = x
	else:
		tmp = z * -x
	return tmp
y = abs(y)
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 7.2e+214)
		tmp = x;
	else
		tmp = Float64(z * Float64(-x));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 7.2e+214)
		tmp = x;
	else
		tmp = z * -x;
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := If[LessEqual[y, 7.2e+214], x, N[(z * (-x)), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{+214}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(-x\right)\\


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

    1. Initial program 96.6%

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

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

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

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

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

    if 7.2000000000000002e214 < y

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 7.2 \cdot 10^{+214}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \]

Alternative 8: 60.9% accurate, 42.1× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.5 \cdot 10^{+213}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t) :precision binary64 (if (<= y 3.5e+213) x (* z t)))
y = abs(y);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 3.5e+213) {
		tmp = x;
	} else {
		tmp = z * t;
	}
	return tmp;
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 3.5d+213) then
        tmp = x
    else
        tmp = z * t
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 3.5e+213) {
		tmp = x;
	} else {
		tmp = z * t;
	}
	return tmp;
}
y = abs(y)
def code(x, y, z, t):
	tmp = 0
	if y <= 3.5e+213:
		tmp = x
	else:
		tmp = z * t
	return tmp
y = abs(y)
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 3.5e+213)
		tmp = x;
	else
		tmp = Float64(z * t);
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 3.5e+213)
		tmp = x;
	else
		tmp = z * t;
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := If[LessEqual[y, 3.5e+213], x, N[(z * t), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{+213}:\\
\;\;\;\;x\\

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


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

    1. Initial program 96.5%

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

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

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

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

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

    if 3.4999999999999997e213 < y

    1. Initial program 55.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.5 \cdot 10^{+213}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]

Alternative 9: 60.7% accurate, 213.0× speedup?

\[\begin{array}{l} y = |y|\\ \\ x \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z t) :precision binary64 x)
y = abs(y);
double code(double x, double y, double z, double t) {
	return x;
}
NOTE: y should be positive before calling this function
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
end function
y = Math.abs(y);
public static double code(double x, double y, double z, double t) {
	return x;
}
y = abs(y)
def code(x, y, z, t):
	return x
y = abs(y)
function code(x, y, z, t)
	return x
end
y = abs(y)
function tmp = code(x, y, z, t)
	tmp = x;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_, t_] := x
\begin{array}{l}
y = |y|\\
\\
x
\end{array}
Derivation
  1. Initial program 94.5%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification64.7%

    \[\leadsto x \]

Developer target: 97.1% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023213 
(FPCore (x y z t)
  :name "SynthBasics:moogVCF from YampaSynth-0.2"
  :precision binary64

  :herbie-target
  (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))

  (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))