Rosa's DopplerBench

Percentage Accurate: 72.8% → 98.8%
Time: 10.1s
Alternatives: 16
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\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 16 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: 72.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 98.8% accurate, 0.6× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;v\_m \leq 5 \cdot 10^{+124}:\\ \;\;\;\;\frac{t1}{t1 \cdot \left(-1 - \frac{u}{t1}\right)} \cdot \frac{v\_m}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m \cdot \frac{t1}{\left(-t1\right) - u}}{t1 + u}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (<= v_m 5e+124)
    (* (/ t1 (* t1 (- -1.0 (/ u t1)))) (/ v_m (+ t1 u)))
    (/ (* v_m (/ t1 (- (- t1) u))) (+ t1 u)))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if (v_m <= 5e+124) {
		tmp = (t1 / (t1 * (-1.0 - (u / t1)))) * (v_m / (t1 + u));
	} else {
		tmp = (v_m * (t1 / (-t1 - u))) / (t1 + u);
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (v_m <= 5d+124) then
        tmp = (t1 / (t1 * ((-1.0d0) - (u / t1)))) * (v_m / (t1 + u))
    else
        tmp = (v_m * (t1 / (-t1 - u))) / (t1 + u)
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if (v_m <= 5e+124) {
		tmp = (t1 / (t1 * (-1.0 - (u / t1)))) * (v_m / (t1 + u));
	} else {
		tmp = (v_m * (t1 / (-t1 - u))) / (t1 + u);
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if v_m <= 5e+124:
		tmp = (t1 / (t1 * (-1.0 - (u / t1)))) * (v_m / (t1 + u))
	else:
		tmp = (v_m * (t1 / (-t1 - u))) / (t1 + u)
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if (v_m <= 5e+124)
		tmp = Float64(Float64(t1 / Float64(t1 * Float64(-1.0 - Float64(u / t1)))) * Float64(v_m / Float64(t1 + u)));
	else
		tmp = Float64(Float64(v_m * Float64(t1 / Float64(Float64(-t1) - u))) / Float64(t1 + u));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if (v_m <= 5e+124)
		tmp = (t1 / (t1 * (-1.0 - (u / t1)))) * (v_m / (t1 + u));
	else
		tmp = (v_m * (t1 / (-t1 - u))) / (t1 + u);
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[LessEqual[v$95$m, 5e+124], N[(N[(t1 / N[(t1 * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(v$95$m / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(v$95$m * N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;v\_m \leq 5 \cdot 10^{+124}:\\
\;\;\;\;\frac{t1}{t1 \cdot \left(-1 - \frac{u}{t1}\right)} \cdot \frac{v\_m}{t1 + u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m \cdot \frac{t1}{\left(-t1\right) - u}}{t1 + u}\\


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

    1. Initial program 77.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg97.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac297.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative97.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around -inf 97.3%

      \[\leadsto \frac{t1}{\color{blue}{-1 \cdot \left(t1 \cdot \left(1 + \frac{u}{t1}\right)\right)}} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r*97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-1 \cdot t1\right) \cdot \left(1 + \frac{u}{t1}\right)}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-t1\right)} \cdot \left(1 + \frac{u}{t1}\right)} \cdot \frac{v}{t1 + u} \]
    7. Simplified97.3%

      \[\leadsto \frac{t1}{\color{blue}{\left(-t1\right) \cdot \left(1 + \frac{u}{t1}\right)}} \cdot \frac{v}{t1 + u} \]

    if 4.9999999999999996e124 < v

    1. Initial program 61.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/71.6%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative71.6%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified71.6%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/61.0%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative61.0%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac95.5%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.7%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt53.2%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod31.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg31.4%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod9.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt12.8%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg12.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative12.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt3.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod29.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg29.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod28.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt9.4%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod37.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg37.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;v \leq 5 \cdot 10^{+124}:\\ \;\;\;\;\frac{t1}{t1 \cdot \left(-1 - \frac{u}{t1}\right)} \cdot \frac{v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{\left(-t1\right) - u}}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.9% accurate, 0.6× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;t1 \leq -1 \cdot 10^{-82} \lor \neg \left(t1 \leq 2.3 \cdot 10^{-113}\right):\\ \;\;\;\;\frac{v\_m \cdot \frac{t1}{\left(-t1\right) - u}}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= t1 -1e-82) (not (<= t1 2.3e-113)))
    (/ (* v_m (/ t1 (- (- t1) u))) t1)
    (/ (- v_m) (* u (/ u t1))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1e-82) || !(t1 <= 2.3e-113)) {
		tmp = (v_m * (t1 / (-t1 - u))) / t1;
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1d-82)) .or. (.not. (t1 <= 2.3d-113))) then
        tmp = (v_m * (t1 / (-t1 - u))) / t1
    else
        tmp = -v_m / (u * (u / t1))
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1e-82) || !(t1 <= 2.3e-113)) {
		tmp = (v_m * (t1 / (-t1 - u))) / t1;
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (t1 <= -1e-82) or not (t1 <= 2.3e-113):
		tmp = (v_m * (t1 / (-t1 - u))) / t1
	else:
		tmp = -v_m / (u * (u / t1))
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((t1 <= -1e-82) || !(t1 <= 2.3e-113))
		tmp = Float64(Float64(v_m * Float64(t1 / Float64(Float64(-t1) - u))) / t1);
	else
		tmp = Float64(Float64(-v_m) / Float64(u * Float64(u / t1)));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((t1 <= -1e-82) || ~((t1 <= 2.3e-113)))
		tmp = (v_m * (t1 / (-t1 - u))) / t1;
	else
		tmp = -v_m / (u * (u / t1));
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[t1, -1e-82], N[Not[LessEqual[t1, 2.3e-113]], $MachinePrecision]], N[(N[(v$95$m * N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision], N[((-v$95$m) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;t1 \leq -1 \cdot 10^{-82} \lor \neg \left(t1 \leq 2.3 \cdot 10^{-113}\right):\\
\;\;\;\;\frac{v\_m \cdot \frac{t1}{\left(-t1\right) - u}}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1e-82 or 2.30000000000000008e-113 < t1

    1. Initial program 67.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/75.9%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative75.9%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified75.9%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/67.7%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative67.7%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt48.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod35.6%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg35.6%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod15.3%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt36.0%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg36.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative36.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt20.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod54.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg54.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod41.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt15.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod43.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg43.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 80.9%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{t1}} \]

    if -1e-82 < t1 < 2.30000000000000008e-113

    1. Initial program 84.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac93.1%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg93.1%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac293.1%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative93.1%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in93.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg93.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified93.1%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.7%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 82.6%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/82.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg82.6%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified82.6%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
    9. Step-by-step derivation
      1. clear-num82.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-t1}}} \cdot \frac{v}{u} \]
      2. frac-2neg82.6%

        \[\leadsto \frac{1}{\frac{u}{-t1}} \cdot \color{blue}{\frac{-v}{-u}} \]
      3. frac-times86.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u}{-t1} \cdot \left(-u\right)}} \]
      4. *-un-lft-identity86.0%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      5. add-sqr-sqrt41.9%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      6. sqrt-unprod50.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      7. sqr-neg50.8%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      8. sqrt-unprod22.6%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      9. add-sqr-sqrt41.1%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      10. add-sqr-sqrt18.8%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}} \cdot \left(-u\right)} \]
      11. sqrt-unprod46.2%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}} \cdot \left(-u\right)} \]
      12. sqr-neg46.2%

        \[\leadsto \frac{v}{\frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}} \cdot \left(-u\right)} \]
      13. sqrt-unprod43.3%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot \left(-u\right)} \]
      14. add-sqr-sqrt86.0%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot \left(-u\right)} \]
    10. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{t1} \cdot \left(-u\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1 \cdot 10^{-82} \lor \neg \left(t1 \leq 2.3 \cdot 10^{-113}\right):\\ \;\;\;\;\frac{v \cdot \frac{t1}{\left(-t1\right) - u}}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.4% accurate, 0.6× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;t1 \leq -1.2 \cdot 10^{-82} \lor \neg \left(t1 \leq 2.1 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{t1}{\left(-t1\right) - u} \cdot \frac{v\_m}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= t1 -1.2e-82) (not (<= t1 2.1e-106)))
    (* (/ t1 (- (- t1) u)) (/ v_m t1))
    (/ (- v_m) (* u (/ u t1))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.2e-82) || !(t1 <= 2.1e-106)) {
		tmp = (t1 / (-t1 - u)) * (v_m / t1);
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.2d-82)) .or. (.not. (t1 <= 2.1d-106))) then
        tmp = (t1 / (-t1 - u)) * (v_m / t1)
    else
        tmp = -v_m / (u * (u / t1))
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.2e-82) || !(t1 <= 2.1e-106)) {
		tmp = (t1 / (-t1 - u)) * (v_m / t1);
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (t1 <= -1.2e-82) or not (t1 <= 2.1e-106):
		tmp = (t1 / (-t1 - u)) * (v_m / t1)
	else:
		tmp = -v_m / (u * (u / t1))
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((t1 <= -1.2e-82) || !(t1 <= 2.1e-106))
		tmp = Float64(Float64(t1 / Float64(Float64(-t1) - u)) * Float64(v_m / t1));
	else
		tmp = Float64(Float64(-v_m) / Float64(u * Float64(u / t1)));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((t1 <= -1.2e-82) || ~((t1 <= 2.1e-106)))
		tmp = (t1 / (-t1 - u)) * (v_m / t1);
	else
		tmp = -v_m / (u * (u / t1));
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[t1, -1.2e-82], N[Not[LessEqual[t1, 2.1e-106]], $MachinePrecision]], N[(N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision] * N[(v$95$m / t1), $MachinePrecision]), $MachinePrecision], N[((-v$95$m) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;t1 \leq -1.2 \cdot 10^{-82} \lor \neg \left(t1 \leq 2.1 \cdot 10^{-106}\right):\\
\;\;\;\;\frac{t1}{\left(-t1\right) - u} \cdot \frac{v\_m}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.20000000000000004e-82 or 2.10000000000000003e-106 < t1

    1. Initial program 67.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 80.1%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]

    if -1.20000000000000004e-82 < t1 < 2.10000000000000003e-106

    1. Initial program 83.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac93.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg93.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac293.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative93.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.2%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 82.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/82.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg82.1%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified82.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
    9. Step-by-step derivation
      1. clear-num82.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-t1}}} \cdot \frac{v}{u} \]
      2. frac-2neg82.1%

        \[\leadsto \frac{1}{\frac{u}{-t1}} \cdot \color{blue}{\frac{-v}{-u}} \]
      3. frac-times85.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u}{-t1} \cdot \left(-u\right)}} \]
      4. *-un-lft-identity85.5%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      5. add-sqr-sqrt41.2%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      6. sqrt-unprod50.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      7. sqr-neg50.8%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      8. sqrt-unprod23.1%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      9. add-sqr-sqrt41.3%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      10. add-sqr-sqrt18.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}} \cdot \left(-u\right)} \]
      11. sqrt-unprod46.3%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}} \cdot \left(-u\right)} \]
      12. sqr-neg46.3%

        \[\leadsto \frac{v}{\frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}} \cdot \left(-u\right)} \]
      13. sqrt-unprod43.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot \left(-u\right)} \]
      14. add-sqr-sqrt85.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot \left(-u\right)} \]
    10. Applied egg-rr85.5%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{t1} \cdot \left(-u\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.2 \cdot 10^{-82} \lor \neg \left(t1 \leq 2.1 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{t1}{\left(-t1\right) - u} \cdot \frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.3% accurate, 0.7× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;t1 \leq -3.2 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.8 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{v\_m}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= t1 -3.2e-78) (not (<= t1 2.8e-106)))
    (/ v_m (- (- t1) (* u 2.0)))
    (/ (- v_m) (* u (/ u t1))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -3.2e-78) || !(t1 <= 2.8e-106)) {
		tmp = v_m / (-t1 - (u * 2.0));
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-3.2d-78)) .or. (.not. (t1 <= 2.8d-106))) then
        tmp = v_m / (-t1 - (u * 2.0d0))
    else
        tmp = -v_m / (u * (u / t1))
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -3.2e-78) || !(t1 <= 2.8e-106)) {
		tmp = v_m / (-t1 - (u * 2.0));
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (t1 <= -3.2e-78) or not (t1 <= 2.8e-106):
		tmp = v_m / (-t1 - (u * 2.0))
	else:
		tmp = -v_m / (u * (u / t1))
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((t1 <= -3.2e-78) || !(t1 <= 2.8e-106))
		tmp = Float64(v_m / Float64(Float64(-t1) - Float64(u * 2.0)));
	else
		tmp = Float64(Float64(-v_m) / Float64(u * Float64(u / t1)));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((t1 <= -3.2e-78) || ~((t1 <= 2.8e-106)))
		tmp = v_m / (-t1 - (u * 2.0));
	else
		tmp = -v_m / (u * (u / t1));
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[t1, -3.2e-78], N[Not[LessEqual[t1, 2.8e-106]], $MachinePrecision]], N[(v$95$m / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v$95$m) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;t1 \leq -3.2 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.8 \cdot 10^{-106}\right):\\
\;\;\;\;\frac{v\_m}{\left(-t1\right) - u \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -3.2e-78 or 2.79999999999999988e-106 < t1

    1. Initial program 67.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/75.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative75.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified75.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/67.9%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative67.9%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt48.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod35.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg35.4%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod14.8%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt35.8%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg35.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative35.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt21.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod53.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg53.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod41.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt15.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod42.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg42.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 99.9%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{t1 \cdot \left(1 + \frac{u}{t1}\right)}} \]
    8. Taylor expanded in v around 0 95.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/95.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
      2. mul-1-neg95.9%

        \[\leadsto \frac{\color{blue}{-v}}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)} \]
    10. Simplified95.9%

      \[\leadsto \color{blue}{\frac{-v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
    11. Taylor expanded in u around 0 79.1%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    12. Step-by-step derivation
      1. *-commutative79.1%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    13. Simplified79.1%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]

    if -3.2e-78 < t1 < 2.79999999999999988e-106

    1. Initial program 83.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac93.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg93.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac293.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative93.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.2%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 82.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/82.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg82.1%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified82.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
    9. Step-by-step derivation
      1. clear-num82.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-t1}}} \cdot \frac{v}{u} \]
      2. frac-2neg82.1%

        \[\leadsto \frac{1}{\frac{u}{-t1}} \cdot \color{blue}{\frac{-v}{-u}} \]
      3. frac-times85.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u}{-t1} \cdot \left(-u\right)}} \]
      4. *-un-lft-identity85.5%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      5. add-sqr-sqrt41.2%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      6. sqrt-unprod50.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      7. sqr-neg50.8%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      8. sqrt-unprod23.1%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      9. add-sqr-sqrt41.3%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      10. add-sqr-sqrt18.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}} \cdot \left(-u\right)} \]
      11. sqrt-unprod46.3%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}} \cdot \left(-u\right)} \]
      12. sqr-neg46.3%

        \[\leadsto \frac{v}{\frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}} \cdot \left(-u\right)} \]
      13. sqrt-unprod43.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot \left(-u\right)} \]
      14. add-sqr-sqrt85.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot \left(-u\right)} \]
    10. Applied egg-rr85.5%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{t1} \cdot \left(-u\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.2 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.8 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.0% accurate, 0.7× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.2 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= t1 -1.5e-78) (not (<= t1 2.2e-106)))
    (/ v_m (- (- t1) u))
    (/ (- v_m) (* u (/ u t1))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.5e-78) || !(t1 <= 2.2e-106)) {
		tmp = v_m / (-t1 - u);
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.5d-78)) .or. (.not. (t1 <= 2.2d-106))) then
        tmp = v_m / (-t1 - u)
    else
        tmp = -v_m / (u * (u / t1))
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.5e-78) || !(t1 <= 2.2e-106)) {
		tmp = v_m / (-t1 - u);
	} else {
		tmp = -v_m / (u * (u / t1));
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (t1 <= -1.5e-78) or not (t1 <= 2.2e-106):
		tmp = v_m / (-t1 - u)
	else:
		tmp = -v_m / (u * (u / t1))
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((t1 <= -1.5e-78) || !(t1 <= 2.2e-106))
		tmp = Float64(v_m / Float64(Float64(-t1) - u));
	else
		tmp = Float64(Float64(-v_m) / Float64(u * Float64(u / t1)));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((t1 <= -1.5e-78) || ~((t1 <= 2.2e-106)))
		tmp = v_m / (-t1 - u);
	else
		tmp = -v_m / (u * (u / t1));
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[t1, -1.5e-78], N[Not[LessEqual[t1, 2.2e-106]], $MachinePrecision]], N[(v$95$m / N[((-t1) - u), $MachinePrecision]), $MachinePrecision], N[((-v$95$m) / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;t1 \leq -1.5 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.2 \cdot 10^{-106}\right):\\
\;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v\_m}{u \cdot \frac{u}{t1}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.49999999999999994e-78 or 2.19999999999999994e-106 < t1

    1. Initial program 67.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/75.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative75.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified75.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/67.9%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative67.9%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt48.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod35.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg35.4%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod14.8%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt35.8%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg35.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative35.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt21.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod53.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg53.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod41.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt15.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod42.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg42.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 78.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg78.8%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified78.8%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]

    if -1.49999999999999994e-78 < t1 < 2.19999999999999994e-106

    1. Initial program 83.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac93.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg93.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac293.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative93.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.2%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 82.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/82.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg82.1%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified82.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
    9. Step-by-step derivation
      1. clear-num82.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-t1}}} \cdot \frac{v}{u} \]
      2. frac-2neg82.1%

        \[\leadsto \frac{1}{\frac{u}{-t1}} \cdot \color{blue}{\frac{-v}{-u}} \]
      3. frac-times85.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u}{-t1} \cdot \left(-u\right)}} \]
      4. *-un-lft-identity85.5%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      5. add-sqr-sqrt41.2%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      6. sqrt-unprod50.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      7. sqr-neg50.8%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      8. sqrt-unprod23.1%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      9. add-sqr-sqrt41.3%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot \left(-u\right)} \]
      10. add-sqr-sqrt18.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}} \cdot \left(-u\right)} \]
      11. sqrt-unprod46.3%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}} \cdot \left(-u\right)} \]
      12. sqr-neg46.3%

        \[\leadsto \frac{v}{\frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}} \cdot \left(-u\right)} \]
      13. sqrt-unprod43.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot \left(-u\right)} \]
      14. add-sqr-sqrt85.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot \left(-u\right)} \]
    10. Applied egg-rr85.5%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{t1} \cdot \left(-u\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.2 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u \cdot \frac{u}{t1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 78.5% accurate, 0.7× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;t1 \leq -1.25 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.8 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v\_m}{u}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= t1 -1.25e-78) (not (<= t1 2.8e-106)))
    (/ v_m (- (- t1) u))
    (* (/ t1 (- u)) (/ v_m u)))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.25e-78) || !(t1 <= 2.8e-106)) {
		tmp = v_m / (-t1 - u);
	} else {
		tmp = (t1 / -u) * (v_m / u);
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.25d-78)) .or. (.not. (t1 <= 2.8d-106))) then
        tmp = v_m / (-t1 - u)
    else
        tmp = (t1 / -u) * (v_m / u)
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.25e-78) || !(t1 <= 2.8e-106)) {
		tmp = v_m / (-t1 - u);
	} else {
		tmp = (t1 / -u) * (v_m / u);
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (t1 <= -1.25e-78) or not (t1 <= 2.8e-106):
		tmp = v_m / (-t1 - u)
	else:
		tmp = (t1 / -u) * (v_m / u)
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((t1 <= -1.25e-78) || !(t1 <= 2.8e-106))
		tmp = Float64(v_m / Float64(Float64(-t1) - u));
	else
		tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v_m / u));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((t1 <= -1.25e-78) || ~((t1 <= 2.8e-106)))
		tmp = v_m / (-t1 - u);
	else
		tmp = (t1 / -u) * (v_m / u);
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[t1, -1.25e-78], N[Not[LessEqual[t1, 2.8e-106]], $MachinePrecision]], N[(v$95$m / N[((-t1) - u), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v$95$m / u), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.8 \cdot 10^{-106}\right):\\
\;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\

\mathbf{else}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v\_m}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.2499999999999999e-78 or 2.79999999999999988e-106 < t1

    1. Initial program 67.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/75.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative75.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified75.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/67.9%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative67.9%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt48.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod35.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg35.4%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod14.8%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt35.8%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg35.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative35.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt21.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod53.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg53.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod41.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt15.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod42.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg42.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 78.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg78.8%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified78.8%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]

    if -1.2499999999999999e-78 < t1 < 2.79999999999999988e-106

    1. Initial program 83.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac93.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg93.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac293.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative93.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg93.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified93.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.2%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 82.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/82.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg82.1%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified82.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.25 \cdot 10^{-78} \lor \neg \left(t1 \leq 2.8 \cdot 10^{-106}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 67.1% accurate, 0.7× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;u \leq -3.7 \cdot 10^{+25} \lor \neg \left(u \leq 1.25 \cdot 10^{+131}\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= u -3.7e+25) (not (<= u 1.25e+131)))
    (/ t1 (* u (/ u v_m)))
    (/ v_m (- (- t1) u)))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((u <= -3.7e+25) || !(u <= 1.25e+131)) {
		tmp = t1 / (u * (u / v_m));
	} else {
		tmp = v_m / (-t1 - u);
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-3.7d+25)) .or. (.not. (u <= 1.25d+131))) then
        tmp = t1 / (u * (u / v_m))
    else
        tmp = v_m / (-t1 - u)
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((u <= -3.7e+25) || !(u <= 1.25e+131)) {
		tmp = t1 / (u * (u / v_m));
	} else {
		tmp = v_m / (-t1 - u);
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (u <= -3.7e+25) or not (u <= 1.25e+131):
		tmp = t1 / (u * (u / v_m))
	else:
		tmp = v_m / (-t1 - u)
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((u <= -3.7e+25) || !(u <= 1.25e+131))
		tmp = Float64(t1 / Float64(u * Float64(u / v_m)));
	else
		tmp = Float64(v_m / Float64(Float64(-t1) - u));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((u <= -3.7e+25) || ~((u <= 1.25e+131)))
		tmp = t1 / (u * (u / v_m));
	else
		tmp = v_m / (-t1 - u);
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[u, -3.7e+25], N[Not[LessEqual[u, 1.25e+131]], $MachinePrecision]], N[(t1 / N[(u * N[(u / v$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v$95$m / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;u \leq -3.7 \cdot 10^{+25} \lor \neg \left(u \leq 1.25 \cdot 10^{+131}\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v\_m}}\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.6999999999999999e25 or 1.24999999999999999e131 < u

    1. Initial program 79.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.1%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.1%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.1%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.1%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.1%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 88.1%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 88.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/88.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg88.1%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified88.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
    9. Step-by-step derivation
      1. *-commutative88.1%

        \[\leadsto \color{blue}{\frac{v}{u} \cdot \frac{-t1}{u}} \]
      2. clear-num88.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \cdot \frac{-t1}{u} \]
      3. frac-times85.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-t1\right)}{\frac{u}{v} \cdot u}} \]
      4. *-un-lft-identity85.4%

        \[\leadsto \frac{\color{blue}{-t1}}{\frac{u}{v} \cdot u} \]
      5. add-sqr-sqrt46.8%

        \[\leadsto \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{\frac{u}{v} \cdot u} \]
      6. sqrt-unprod65.2%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\frac{u}{v} \cdot u} \]
      7. sqr-neg65.2%

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{v} \cdot u} \]
      8. sqrt-unprod31.0%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{v} \cdot u} \]
      9. add-sqr-sqrt71.2%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{v} \cdot u} \]
    10. Applied egg-rr71.2%

      \[\leadsto \color{blue}{\frac{t1}{\frac{u}{v} \cdot u}} \]

    if -3.6999999999999999e25 < u < 1.24999999999999999e131

    1. Initial program 72.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative82.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified82.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/72.2%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative72.2%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac95.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/96.8%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt48.2%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod31.3%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg31.3%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod11.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt20.1%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg20.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative20.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt8.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod38.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg38.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod35.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt11.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod43.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg43.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr96.8%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 66.9%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg66.9%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified66.9%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.7 \cdot 10^{+25} \lor \neg \left(u \leq 1.25 \cdot 10^{+131}\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 66.8% accurate, 0.7× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;u \leq -3.7 \cdot 10^{+25}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v\_m}}\\ \mathbf{elif}\;u \leq 1.2 \cdot 10^{+131}:\\ \;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m \cdot t1}{u \cdot u}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (<= u -3.7e+25)
    (/ t1 (* u (/ u v_m)))
    (if (<= u 1.2e+131) (/ v_m (- (- t1) u)) (/ (* v_m t1) (* u u))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if (u <= -3.7e+25) {
		tmp = t1 / (u * (u / v_m));
	} else if (u <= 1.2e+131) {
		tmp = v_m / (-t1 - u);
	} else {
		tmp = (v_m * t1) / (u * u);
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-3.7d+25)) then
        tmp = t1 / (u * (u / v_m))
    else if (u <= 1.2d+131) then
        tmp = v_m / (-t1 - u)
    else
        tmp = (v_m * t1) / (u * u)
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if (u <= -3.7e+25) {
		tmp = t1 / (u * (u / v_m));
	} else if (u <= 1.2e+131) {
		tmp = v_m / (-t1 - u);
	} else {
		tmp = (v_m * t1) / (u * u);
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if u <= -3.7e+25:
		tmp = t1 / (u * (u / v_m))
	elif u <= 1.2e+131:
		tmp = v_m / (-t1 - u)
	else:
		tmp = (v_m * t1) / (u * u)
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if (u <= -3.7e+25)
		tmp = Float64(t1 / Float64(u * Float64(u / v_m)));
	elseif (u <= 1.2e+131)
		tmp = Float64(v_m / Float64(Float64(-t1) - u));
	else
		tmp = Float64(Float64(v_m * t1) / Float64(u * u));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if (u <= -3.7e+25)
		tmp = t1 / (u * (u / v_m));
	elseif (u <= 1.2e+131)
		tmp = v_m / (-t1 - u);
	else
		tmp = (v_m * t1) / (u * u);
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[LessEqual[u, -3.7e+25], N[(t1 / N[(u * N[(u / v$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.2e+131], N[(v$95$m / N[((-t1) - u), $MachinePrecision]), $MachinePrecision], N[(N[(v$95$m * t1), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;u \leq -3.7 \cdot 10^{+25}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v\_m}}\\

\mathbf{elif}\;u \leq 1.2 \cdot 10^{+131}:\\
\;\;\;\;\frac{v\_m}{\left(-t1\right) - u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m \cdot t1}{u \cdot u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -3.6999999999999999e25

    1. Initial program 81.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 82.8%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 82.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/82.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg82.8%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified82.8%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
    9. Step-by-step derivation
      1. *-commutative82.8%

        \[\leadsto \color{blue}{\frac{v}{u} \cdot \frac{-t1}{u}} \]
      2. clear-num82.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \cdot \frac{-t1}{u} \]
      3. frac-times82.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-t1\right)}{\frac{u}{v} \cdot u}} \]
      4. *-un-lft-identity82.4%

        \[\leadsto \frac{\color{blue}{-t1}}{\frac{u}{v} \cdot u} \]
      5. add-sqr-sqrt42.9%

        \[\leadsto \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{\frac{u}{v} \cdot u} \]
      6. sqrt-unprod58.7%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\frac{u}{v} \cdot u} \]
      7. sqr-neg58.7%

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{v} \cdot u} \]
      8. sqrt-unprod30.2%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{v} \cdot u} \]
      9. add-sqr-sqrt65.4%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{v} \cdot u} \]
    10. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{t1}{\frac{u}{v} \cdot u}} \]

    if -3.6999999999999999e25 < u < 1.2e131

    1. Initial program 72.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative82.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified82.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/72.2%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative72.2%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac95.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg95.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/96.8%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt48.2%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod31.3%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg31.3%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod11.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt20.1%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg20.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative20.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt8.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod38.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg38.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod35.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt11.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod43.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg43.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr96.8%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 66.9%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg66.9%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified66.9%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]

    if 1.2e131 < u

    1. Initial program 77.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 93.8%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 93.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/93.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg93.7%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified93.7%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
    9. Step-by-step derivation
      1. frac-2neg93.7%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-u}} \cdot \frac{v}{u} \]
      2. frac-times77.3%

        \[\leadsto \color{blue}{\frac{\left(-\left(-t1\right)\right) \cdot v}{\left(-u\right) \cdot u}} \]
      3. remove-double-neg77.3%

        \[\leadsto \frac{\color{blue}{t1} \cdot v}{\left(-u\right) \cdot u} \]
    10. Applied egg-rr77.3%

      \[\leadsto \color{blue}{\frac{t1 \cdot v}{\left(-u\right) \cdot u}} \]
    11. Step-by-step derivation
      1. neg-sub077.3%

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(0 - u\right)} \cdot u} \]
      2. sub-neg77.3%

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(0 + \left(-u\right)\right)} \cdot u} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \frac{t1 \cdot v}{\left(0 + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right) \cdot u} \]
      4. sqrt-unprod77.3%

        \[\leadsto \frac{t1 \cdot v}{\left(0 + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right) \cdot u} \]
      5. sqr-neg77.3%

        \[\leadsto \frac{t1 \cdot v}{\left(0 + \sqrt{\color{blue}{u \cdot u}}\right) \cdot u} \]
      6. sqrt-unprod77.3%

        \[\leadsto \frac{t1 \cdot v}{\left(0 + \color{blue}{\sqrt{u} \cdot \sqrt{u}}\right) \cdot u} \]
      7. add-sqr-sqrt77.3%

        \[\leadsto \frac{t1 \cdot v}{\left(0 + \color{blue}{u}\right) \cdot u} \]
    12. Applied egg-rr77.3%

      \[\leadsto \frac{t1 \cdot v}{\color{blue}{\left(0 + u\right)} \cdot u} \]
    13. Step-by-step derivation
      1. +-lft-identity77.3%

        \[\leadsto \frac{t1 \cdot v}{\color{blue}{u} \cdot u} \]
    14. Simplified77.3%

      \[\leadsto \frac{t1 \cdot v}{\color{blue}{u} \cdot u} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.7 \cdot 10^{+25}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.2 \cdot 10^{+131}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot t1}{u \cdot u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 98.9% accurate, 0.7× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ \begin{array}{l} t_1 := \frac{t1}{\left(-t1\right) - u}\\ v\_s \cdot \begin{array}{l} \mathbf{if}\;v\_m \leq 10^{+121}:\\ \;\;\;\;\frac{v\_m}{t1 + u} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m \cdot t\_1}{t1 + u}\\ \end{array} \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (let* ((t_1 (/ t1 (- (- t1) u))))
   (*
    v_s
    (if (<= v_m 1e+121) (* (/ v_m (+ t1 u)) t_1) (/ (* v_m t_1) (+ t1 u))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double t_1 = t1 / (-t1 - u);
	double tmp;
	if (v_m <= 1e+121) {
		tmp = (v_m / (t1 + u)) * t_1;
	} else {
		tmp = (v_m * t_1) / (t1 + u);
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t1 / (-t1 - u)
    if (v_m <= 1d+121) then
        tmp = (v_m / (t1 + u)) * t_1
    else
        tmp = (v_m * t_1) / (t1 + u)
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double t_1 = t1 / (-t1 - u);
	double tmp;
	if (v_m <= 1e+121) {
		tmp = (v_m / (t1 + u)) * t_1;
	} else {
		tmp = (v_m * t_1) / (t1 + u);
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	t_1 = t1 / (-t1 - u)
	tmp = 0
	if v_m <= 1e+121:
		tmp = (v_m / (t1 + u)) * t_1
	else:
		tmp = (v_m * t_1) / (t1 + u)
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	t_1 = Float64(t1 / Float64(Float64(-t1) - u))
	tmp = 0.0
	if (v_m <= 1e+121)
		tmp = Float64(Float64(v_m / Float64(t1 + u)) * t_1);
	else
		tmp = Float64(Float64(v_m * t_1) / Float64(t1 + u));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	t_1 = t1 / (-t1 - u);
	tmp = 0.0;
	if (v_m <= 1e+121)
		tmp = (v_m / (t1 + u)) * t_1;
	else
		tmp = (v_m * t_1) / (t1 + u);
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := Block[{t$95$1 = N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]}, N[(v$95$s * If[LessEqual[v$95$m, 1e+121], N[(N[(v$95$m / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(v$95$m * t$95$1), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
\begin{array}{l}
t_1 := \frac{t1}{\left(-t1\right) - u}\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;v\_m \leq 10^{+121}:\\
\;\;\;\;\frac{v\_m}{t1 + u} \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m \cdot t\_1}{t1 + u}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if v < 1.00000000000000004e121

    1. Initial program 77.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg97.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac297.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative97.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing

    if 1.00000000000000004e121 < v

    1. Initial program 61.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/72.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative72.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified72.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/61.9%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative61.9%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac95.5%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg95.5%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.7%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt52.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod30.8%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg30.8%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod9.6%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt12.5%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg12.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative12.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt3.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod29.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg29.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod27.9%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt9.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod38.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg38.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;v \leq 10^{+121}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{\left(-t1\right) - u}}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 96.1% accurate, 0.7× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;t1 \leq -8 \cdot 10^{-125}:\\ \;\;\;\;\frac{v\_m}{t1 + u} \cdot \frac{t1}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (<= t1 -8e-125)
    (* (/ v_m (+ t1 u)) (/ t1 (- (- t1) u)))
    (/ v_m (* (+ t1 u) (- -1.0 (/ u t1)))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if (t1 <= -8e-125) {
		tmp = (v_m / (t1 + u)) * (t1 / (-t1 - u));
	} else {
		tmp = v_m / ((t1 + u) * (-1.0 - (u / t1)));
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-8d-125)) then
        tmp = (v_m / (t1 + u)) * (t1 / (-t1 - u))
    else
        tmp = v_m / ((t1 + u) * ((-1.0d0) - (u / t1)))
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if (t1 <= -8e-125) {
		tmp = (v_m / (t1 + u)) * (t1 / (-t1 - u));
	} else {
		tmp = v_m / ((t1 + u) * (-1.0 - (u / t1)));
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if t1 <= -8e-125:
		tmp = (v_m / (t1 + u)) * (t1 / (-t1 - u))
	else:
		tmp = v_m / ((t1 + u) * (-1.0 - (u / t1)))
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if (t1 <= -8e-125)
		tmp = Float64(Float64(v_m / Float64(t1 + u)) * Float64(t1 / Float64(Float64(-t1) - u)));
	else
		tmp = Float64(v_m / Float64(Float64(t1 + u) * Float64(-1.0 - Float64(u / t1))));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if (t1 <= -8e-125)
		tmp = (v_m / (t1 + u)) * (t1 / (-t1 - u));
	else
		tmp = v_m / ((t1 + u) * (-1.0 - (u / t1)));
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[LessEqual[t1, -8e-125], N[(N[(v$95$m / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v$95$m / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;t1 \leq -8 \cdot 10^{-125}:\\
\;\;\;\;\frac{v\_m}{t1 + u} \cdot \frac{t1}{\left(-t1\right) - u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -8.0000000000000001e-125

    1. Initial program 70.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.8%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.8%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.8%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing

    if -8.0000000000000001e-125 < t1

    1. Initial program 76.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative83.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified83.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/76.8%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative76.8%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac95.7%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg95.7%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative95.7%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in95.7%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg95.7%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/96.6%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt27.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod36.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg36.0%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod26.6%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt36.6%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg36.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative36.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt10.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod53.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg53.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod51.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt20.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod57.2%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg57.2%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr96.6%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 96.6%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{t1 \cdot \left(1 + \frac{u}{t1}\right)}} \]
    8. Taylor expanded in v around 0 98.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/98.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
      2. mul-1-neg98.4%

        \[\leadsto \frac{\color{blue}{-v}}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)} \]
    10. Simplified98.4%

      \[\leadsto \color{blue}{\frac{-v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
    11. Taylor expanded in v around 0 98.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
    12. Step-by-step derivation
      1. associate-/r*96.6%

        \[\leadsto -1 \cdot \color{blue}{\frac{\frac{v}{1 + \frac{u}{t1}}}{t1 + u}} \]
      2. +-commutative96.6%

        \[\leadsto -1 \cdot \frac{\frac{v}{1 + \frac{u}{t1}}}{\color{blue}{u + t1}} \]
      3. associate-/r*98.4%

        \[\leadsto -1 \cdot \color{blue}{\frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(u + t1\right)}} \]
      4. neg-mul-198.4%

        \[\leadsto \color{blue}{-\frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(u + t1\right)}} \]
      5. distribute-neg-frac298.4%

        \[\leadsto \color{blue}{\frac{v}{-\left(1 + \frac{u}{t1}\right) \cdot \left(u + t1\right)}} \]
      6. *-commutative98.4%

        \[\leadsto \frac{v}{-\color{blue}{\left(u + t1\right) \cdot \left(1 + \frac{u}{t1}\right)}} \]
      7. distribute-rgt-neg-in98.4%

        \[\leadsto \frac{v}{\color{blue}{\left(u + t1\right) \cdot \left(-\left(1 + \frac{u}{t1}\right)\right)}} \]
      8. distribute-neg-in98.4%

        \[\leadsto \frac{v}{\left(u + t1\right) \cdot \color{blue}{\left(\left(-1\right) + \left(-\frac{u}{t1}\right)\right)}} \]
      9. metadata-eval98.4%

        \[\leadsto \frac{v}{\left(u + t1\right) \cdot \left(\color{blue}{-1} + \left(-\frac{u}{t1}\right)\right)} \]
      10. unsub-neg98.4%

        \[\leadsto \frac{v}{\left(u + t1\right) \cdot \color{blue}{\left(-1 - \frac{u}{t1}\right)}} \]
    13. Simplified98.4%

      \[\leadsto \color{blue}{\frac{v}{\left(u + t1\right) \cdot \left(-1 - \frac{u}{t1}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -8 \cdot 10^{-125}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{\left(-t1\right) - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.0% accurate, 0.9× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;u \leq -1.3 \cdot 10^{+204} \lor \neg \left(u \leq 3.6 \cdot 10^{+115}\right):\\ \;\;\;\;\frac{-v\_m}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m}{-t1}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= u -1.3e+204) (not (<= u 3.6e+115)))
    (/ (- v_m) u)
    (/ v_m (- t1)))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((u <= -1.3e+204) || !(u <= 3.6e+115)) {
		tmp = -v_m / u;
	} else {
		tmp = v_m / -t1;
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-1.3d+204)) .or. (.not. (u <= 3.6d+115))) then
        tmp = -v_m / u
    else
        tmp = v_m / -t1
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((u <= -1.3e+204) || !(u <= 3.6e+115)) {
		tmp = -v_m / u;
	} else {
		tmp = v_m / -t1;
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (u <= -1.3e+204) or not (u <= 3.6e+115):
		tmp = -v_m / u
	else:
		tmp = v_m / -t1
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((u <= -1.3e+204) || !(u <= 3.6e+115))
		tmp = Float64(Float64(-v_m) / u);
	else
		tmp = Float64(v_m / Float64(-t1));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((u <= -1.3e+204) || ~((u <= 3.6e+115)))
		tmp = -v_m / u;
	else
		tmp = v_m / -t1;
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[u, -1.3e+204], N[Not[LessEqual[u, 3.6e+115]], $MachinePrecision]], N[((-v$95$m) / u), $MachinePrecision], N[(v$95$m / (-t1)), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;u \leq -1.3 \cdot 10^{+204} \lor \neg \left(u \leq 3.6 \cdot 10^{+115}\right):\\
\;\;\;\;\frac{-v\_m}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m}{-t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.3000000000000001e204 or 3.6000000000000001e115 < u

    1. Initial program 77.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 94.4%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around inf 43.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. associate-*r/43.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \]
      2. mul-1-neg43.3%

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified43.3%

      \[\leadsto \color{blue}{\frac{-v}{u}} \]

    if -1.3000000000000001e204 < u < 3.6000000000000001e115

    1. Initial program 73.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/81.7%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative81.7%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified81.7%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 62.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/62.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-162.5%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified62.5%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.3 \cdot 10^{+204} \lor \neg \left(u \leq 3.6 \cdot 10^{+115}\right):\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 58.1% accurate, 0.9× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;u \leq -1.3 \cdot 10^{+204} \lor \neg \left(u \leq 1.05 \cdot 10^{+117}\right):\\ \;\;\;\;\frac{v\_m}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m}{-t1}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= u -1.3e+204) (not (<= u 1.05e+117))) (/ v_m u) (/ v_m (- t1)))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((u <= -1.3e+204) || !(u <= 1.05e+117)) {
		tmp = v_m / u;
	} else {
		tmp = v_m / -t1;
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-1.3d+204)) .or. (.not. (u <= 1.05d+117))) then
        tmp = v_m / u
    else
        tmp = v_m / -t1
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((u <= -1.3e+204) || !(u <= 1.05e+117)) {
		tmp = v_m / u;
	} else {
		tmp = v_m / -t1;
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (u <= -1.3e+204) or not (u <= 1.05e+117):
		tmp = v_m / u
	else:
		tmp = v_m / -t1
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((u <= -1.3e+204) || !(u <= 1.05e+117))
		tmp = Float64(v_m / u);
	else
		tmp = Float64(v_m / Float64(-t1));
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((u <= -1.3e+204) || ~((u <= 1.05e+117)))
		tmp = v_m / u;
	else
		tmp = v_m / -t1;
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[u, -1.3e+204], N[Not[LessEqual[u, 1.05e+117]], $MachinePrecision]], N[(v$95$m / u), $MachinePrecision], N[(v$95$m / (-t1)), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;u \leq -1.3 \cdot 10^{+204} \lor \neg \left(u \leq 1.05 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{v\_m}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m}{-t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.3000000000000001e204 or 1.0500000000000001e117 < u

    1. Initial program 77.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 94.4%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around inf 43.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. associate-*r/43.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \]
      2. mul-1-neg43.3%

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified43.3%

      \[\leadsto \color{blue}{\frac{-v}{u}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt26.8%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{u} \]
      2. sqrt-unprod42.6%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{u} \]
      3. sqr-neg42.6%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{u} \]
      4. sqrt-unprod16.2%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{u} \]
      5. add-sqr-sqrt43.0%

        \[\leadsto \frac{\color{blue}{v}}{u} \]
      6. div-inv43.0%

        \[\leadsto \color{blue}{v \cdot \frac{1}{u}} \]
    10. Applied egg-rr43.0%

      \[\leadsto \color{blue}{v \cdot \frac{1}{u}} \]
    11. Step-by-step derivation
      1. associate-*r/43.0%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{u}} \]
      2. *-rgt-identity43.0%

        \[\leadsto \frac{\color{blue}{v}}{u} \]
    12. Simplified43.0%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -1.3000000000000001e204 < u < 1.0500000000000001e117

    1. Initial program 73.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/81.7%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative81.7%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified81.7%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 62.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/62.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-162.5%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified62.5%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.3 \cdot 10^{+204} \lor \neg \left(u \leq 1.05 \cdot 10^{+117}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 23.3% accurate, 0.9× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \begin{array}{l} \mathbf{if}\;t1 \leq -1.06 \cdot 10^{+170} \lor \neg \left(t1 \leq 7.8 \cdot 10^{+87}\right):\\ \;\;\;\;\frac{v\_m}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v\_m}{u}\\ \end{array} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (*
  v_s
  (if (or (<= t1 -1.06e+170) (not (<= t1 7.8e+87))) (/ v_m t1) (/ v_m u))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.06e+170) || !(t1 <= 7.8e+87)) {
		tmp = v_m / t1;
	} else {
		tmp = v_m / u;
	}
	return v_s * tmp;
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.06d+170)) .or. (.not. (t1 <= 7.8d+87))) then
        tmp = v_m / t1
    else
        tmp = v_m / u
    end if
    code = v_s * tmp
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	double tmp;
	if ((t1 <= -1.06e+170) || !(t1 <= 7.8e+87)) {
		tmp = v_m / t1;
	} else {
		tmp = v_m / u;
	}
	return v_s * tmp;
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	tmp = 0
	if (t1 <= -1.06e+170) or not (t1 <= 7.8e+87):
		tmp = v_m / t1
	else:
		tmp = v_m / u
	return v_s * tmp
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	tmp = 0.0
	if ((t1 <= -1.06e+170) || !(t1 <= 7.8e+87))
		tmp = Float64(v_m / t1);
	else
		tmp = Float64(v_m / u);
	end
	return Float64(v_s * tmp)
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp_2 = code(v_s, u, v_m, t1)
	tmp = 0.0;
	if ((t1 <= -1.06e+170) || ~((t1 <= 7.8e+87)))
		tmp = v_m / t1;
	else
		tmp = v_m / u;
	end
	tmp_2 = v_s * tmp;
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * If[Or[LessEqual[t1, -1.06e+170], N[Not[LessEqual[t1, 7.8e+87]], $MachinePrecision]], N[(v$95$m / t1), $MachinePrecision], N[(v$95$m / u), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \begin{array}{l}
\mathbf{if}\;t1 \leq -1.06 \cdot 10^{+170} \lor \neg \left(t1 \leq 7.8 \cdot 10^{+87}\right):\\
\;\;\;\;\frac{v\_m}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v\_m}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.05999999999999998e170 or 7.80000000000000039e87 < t1

    1. Initial program 46.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/52.3%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative52.3%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified52.3%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 89.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/89.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-189.7%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified89.7%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
    8. Step-by-step derivation
      1. div-inv89.5%

        \[\leadsto \color{blue}{\left(-v\right) \cdot \frac{1}{t1}} \]
      2. add-sqr-sqrt42.4%

        \[\leadsto \color{blue}{\left(\sqrt{-v} \cdot \sqrt{-v}\right)} \cdot \frac{1}{t1} \]
      3. sqrt-unprod50.6%

        \[\leadsto \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}} \cdot \frac{1}{t1} \]
      4. sqr-neg50.6%

        \[\leadsto \sqrt{\color{blue}{v \cdot v}} \cdot \frac{1}{t1} \]
      5. sqrt-unprod17.2%

        \[\leadsto \color{blue}{\left(\sqrt{v} \cdot \sqrt{v}\right)} \cdot \frac{1}{t1} \]
      6. add-sqr-sqrt39.8%

        \[\leadsto \color{blue}{v} \cdot \frac{1}{t1} \]
    9. Applied egg-rr39.8%

      \[\leadsto \color{blue}{v \cdot \frac{1}{t1}} \]
    10. Step-by-step derivation
      1. associate-*r/39.8%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{t1}} \]
      2. *-rgt-identity39.8%

        \[\leadsto \frac{\color{blue}{v}}{t1} \]
    11. Simplified39.8%

      \[\leadsto \color{blue}{\frac{v}{t1}} \]

    if -1.05999999999999998e170 < t1 < 7.80000000000000039e87

    1. Initial program 83.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac96.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg96.0%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac296.0%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative96.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in96.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg96.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 65.6%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around inf 21.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. associate-*r/21.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \]
      2. mul-1-neg21.1%

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified21.1%

      \[\leadsto \color{blue}{\frac{-v}{u}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt12.2%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{u} \]
      2. sqrt-unprod24.1%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{u} \]
      3. sqr-neg24.1%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{u} \]
      4. sqrt-unprod7.1%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{u} \]
      5. add-sqr-sqrt18.1%

        \[\leadsto \frac{\color{blue}{v}}{u} \]
      6. div-inv18.1%

        \[\leadsto \color{blue}{v \cdot \frac{1}{u}} \]
    10. Applied egg-rr18.1%

      \[\leadsto \color{blue}{v \cdot \frac{1}{u}} \]
    11. Step-by-step derivation
      1. associate-*r/18.1%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{u}} \]
      2. *-rgt-identity18.1%

        \[\leadsto \frac{\color{blue}{v}}{u} \]
    12. Simplified18.1%

      \[\leadsto \color{blue}{\frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.06 \cdot 10^{+170} \lor \neg \left(t1 \leq 7.8 \cdot 10^{+87}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 94.4% accurate, 1.1× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \frac{v\_m}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1)
 :precision binary64
 (* v_s (/ v_m (* (+ t1 u) (- -1.0 (/ u t1))))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	return v_s * (v_m / ((t1 + u) * (-1.0 - (u / t1))));
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    code = v_s * (v_m / ((t1 + u) * ((-1.0d0) - (u / t1))))
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	return v_s * (v_m / ((t1 + u) * (-1.0 - (u / t1))));
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	return v_s * (v_m / ((t1 + u) * (-1.0 - (u / t1))))
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	return Float64(v_s * Float64(v_m / Float64(Float64(t1 + u) * Float64(-1.0 - Float64(u / t1)))))
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp = code(v_s, u, v_m, t1)
	tmp = v_s * (v_m / ((t1 + u) * (-1.0 - (u / t1))));
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * N[(v$95$m / N[(N[(t1 + u), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \frac{v\_m}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)}
\end{array}
Derivation
  1. Initial program 74.8%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/80.8%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. *-commutative80.8%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  3. Simplified80.8%

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/74.8%

      \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    2. *-commutative74.8%

      \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    3. times-frac97.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. frac-2neg97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
    5. +-commutative97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
    6. distribute-neg-in97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
    7. sub-neg97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
    8. associate-*r/97.6%

      \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
    9. add-sqr-sqrt49.9%

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    10. sqrt-unprod43.8%

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    11. sqr-neg43.8%

      \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    12. sqrt-unprod18.4%

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    13. add-sqr-sqrt38.3%

      \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    14. sub-neg38.3%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
    15. +-commutative38.3%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
    16. add-sqr-sqrt19.9%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
    17. sqrt-unprod50.1%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
    18. sqr-neg50.1%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
    19. sqrt-unprod35.4%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
    20. add-sqr-sqrt14.2%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
    21. sqrt-unprod39.5%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
    22. sqr-neg39.5%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
  6. Applied egg-rr97.6%

    \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
  7. Taylor expanded in t1 around inf 97.6%

    \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{t1 \cdot \left(1 + \frac{u}{t1}\right)}} \]
  8. Taylor expanded in v around 0 96.2%

    \[\leadsto \color{blue}{-1 \cdot \frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
  9. Step-by-step derivation
    1. associate-*r/96.2%

      \[\leadsto \color{blue}{\frac{-1 \cdot v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
    2. mul-1-neg96.2%

      \[\leadsto \frac{\color{blue}{-v}}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)} \]
  10. Simplified96.2%

    \[\leadsto \color{blue}{\frac{-v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
  11. Taylor expanded in v around 0 96.2%

    \[\leadsto \color{blue}{-1 \cdot \frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(t1 + u\right)}} \]
  12. Step-by-step derivation
    1. associate-/r*97.7%

      \[\leadsto -1 \cdot \color{blue}{\frac{\frac{v}{1 + \frac{u}{t1}}}{t1 + u}} \]
    2. +-commutative97.7%

      \[\leadsto -1 \cdot \frac{\frac{v}{1 + \frac{u}{t1}}}{\color{blue}{u + t1}} \]
    3. associate-/r*96.2%

      \[\leadsto -1 \cdot \color{blue}{\frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(u + t1\right)}} \]
    4. neg-mul-196.2%

      \[\leadsto \color{blue}{-\frac{v}{\left(1 + \frac{u}{t1}\right) \cdot \left(u + t1\right)}} \]
    5. distribute-neg-frac296.2%

      \[\leadsto \color{blue}{\frac{v}{-\left(1 + \frac{u}{t1}\right) \cdot \left(u + t1\right)}} \]
    6. *-commutative96.2%

      \[\leadsto \frac{v}{-\color{blue}{\left(u + t1\right) \cdot \left(1 + \frac{u}{t1}\right)}} \]
    7. distribute-rgt-neg-in96.2%

      \[\leadsto \frac{v}{\color{blue}{\left(u + t1\right) \cdot \left(-\left(1 + \frac{u}{t1}\right)\right)}} \]
    8. distribute-neg-in96.2%

      \[\leadsto \frac{v}{\left(u + t1\right) \cdot \color{blue}{\left(\left(-1\right) + \left(-\frac{u}{t1}\right)\right)}} \]
    9. metadata-eval96.2%

      \[\leadsto \frac{v}{\left(u + t1\right) \cdot \left(\color{blue}{-1} + \left(-\frac{u}{t1}\right)\right)} \]
    10. unsub-neg96.2%

      \[\leadsto \frac{v}{\left(u + t1\right) \cdot \color{blue}{\left(-1 - \frac{u}{t1}\right)}} \]
  13. Simplified96.2%

    \[\leadsto \color{blue}{\frac{v}{\left(u + t1\right) \cdot \left(-1 - \frac{u}{t1}\right)}} \]
  14. Final simplification96.2%

    \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(-1 - \frac{u}{t1}\right)} \]
  15. Add Preprocessing

Alternative 15: 61.5% accurate, 2.0× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \frac{v\_m}{\left(-t1\right) - u} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1) :precision binary64 (* v_s (/ v_m (- (- t1) u))))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	return v_s * (v_m / (-t1 - u));
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    code = v_s * (v_m / (-t1 - u))
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	return v_s * (v_m / (-t1 - u));
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	return v_s * (v_m / (-t1 - u))
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	return Float64(v_s * Float64(v_m / Float64(Float64(-t1) - u)))
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp = code(v_s, u, v_m, t1)
	tmp = v_s * (v_m / (-t1 - u));
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * N[(v$95$m / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \frac{v\_m}{\left(-t1\right) - u}
\end{array}
Derivation
  1. Initial program 74.8%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/80.8%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. *-commutative80.8%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  3. Simplified80.8%

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/74.8%

      \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    2. *-commutative74.8%

      \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    3. times-frac97.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. frac-2neg97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
    5. +-commutative97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
    6. distribute-neg-in97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
    7. sub-neg97.0%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
    8. associate-*r/97.6%

      \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
    9. add-sqr-sqrt49.9%

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    10. sqrt-unprod43.8%

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    11. sqr-neg43.8%

      \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    12. sqrt-unprod18.4%

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    13. add-sqr-sqrt38.3%

      \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
    14. sub-neg38.3%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
    15. +-commutative38.3%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
    16. add-sqr-sqrt19.9%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
    17. sqrt-unprod50.1%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
    18. sqr-neg50.1%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
    19. sqrt-unprod35.4%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
    20. add-sqr-sqrt14.2%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
    21. sqrt-unprod39.5%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
    22. sqr-neg39.5%

      \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
  6. Applied egg-rr97.6%

    \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
  7. Taylor expanded in t1 around inf 59.1%

    \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
  8. Step-by-step derivation
    1. mul-1-neg59.1%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  9. Simplified59.1%

    \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  10. Final simplification59.1%

    \[\leadsto \frac{v}{\left(-t1\right) - u} \]
  11. Add Preprocessing

Alternative 16: 14.0% accurate, 4.0× speedup?

\[\begin{array}{l} v\_m = \left|v\right| \\ v\_s = \mathsf{copysign}\left(1, v\right) \\ v\_s \cdot \frac{v\_m}{t1} \end{array} \]
v\_m = (fabs.f64 v)
v\_s = (copysign.f64 #s(literal 1 binary64) v)
(FPCore (v_s u v_m t1) :precision binary64 (* v_s (/ v_m t1)))
v\_m = fabs(v);
v\_s = copysign(1.0, v);
double code(double v_s, double u, double v_m, double t1) {
	return v_s * (v_m / t1);
}
v\_m = abs(v)
v\_s = copysign(1.0d0, v)
real(8) function code(v_s, u, v_m, t1)
    real(8), intent (in) :: v_s
    real(8), intent (in) :: u
    real(8), intent (in) :: v_m
    real(8), intent (in) :: t1
    code = v_s * (v_m / t1)
end function
v\_m = Math.abs(v);
v\_s = Math.copySign(1.0, v);
public static double code(double v_s, double u, double v_m, double t1) {
	return v_s * (v_m / t1);
}
v\_m = math.fabs(v)
v\_s = math.copysign(1.0, v)
def code(v_s, u, v_m, t1):
	return v_s * (v_m / t1)
v\_m = abs(v)
v\_s = copysign(1.0, v)
function code(v_s, u, v_m, t1)
	return Float64(v_s * Float64(v_m / t1))
end
v\_m = abs(v);
v\_s = sign(v) * abs(1.0);
function tmp = code(v_s, u, v_m, t1)
	tmp = v_s * (v_m / t1);
end
v\_m = N[Abs[v], $MachinePrecision]
v\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[v]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[v$95$s_, u_, v$95$m_, t1_] := N[(v$95$s * N[(v$95$m / t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
v\_m = \left|v\right|
\\
v\_s = \mathsf{copysign}\left(1, v\right)

\\
v\_s \cdot \frac{v\_m}{t1}
\end{array}
Derivation
  1. Initial program 74.8%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/80.8%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. *-commutative80.8%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  3. Simplified80.8%

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 50.2%

    \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
  6. Step-by-step derivation
    1. associate-*r/50.2%

      \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
    2. neg-mul-150.2%

      \[\leadsto \frac{\color{blue}{-v}}{t1} \]
  7. Simplified50.2%

    \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  8. Step-by-step derivation
    1. div-inv50.1%

      \[\leadsto \color{blue}{\left(-v\right) \cdot \frac{1}{t1}} \]
    2. add-sqr-sqrt24.0%

      \[\leadsto \color{blue}{\left(\sqrt{-v} \cdot \sqrt{-v}\right)} \cdot \frac{1}{t1} \]
    3. sqrt-unprod31.6%

      \[\leadsto \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}} \cdot \frac{1}{t1} \]
    4. sqr-neg31.6%

      \[\leadsto \sqrt{\color{blue}{v \cdot v}} \cdot \frac{1}{t1} \]
    5. sqrt-unprod5.4%

      \[\leadsto \color{blue}{\left(\sqrt{v} \cdot \sqrt{v}\right)} \cdot \frac{1}{t1} \]
    6. add-sqr-sqrt13.6%

      \[\leadsto \color{blue}{v} \cdot \frac{1}{t1} \]
  9. Applied egg-rr13.6%

    \[\leadsto \color{blue}{v \cdot \frac{1}{t1}} \]
  10. Step-by-step derivation
    1. associate-*r/13.6%

      \[\leadsto \color{blue}{\frac{v \cdot 1}{t1}} \]
    2. *-rgt-identity13.6%

      \[\leadsto \frac{\color{blue}{v}}{t1} \]
  11. Simplified13.6%

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024181 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))