Rosa's DopplerBench

Percentage Accurate: 72.6% → 98.0%
Time: 11.5s
Alternatives: 15
Speedup: 1.0×

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 15 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.6% 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.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (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 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1):
	return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 / (t1 + u)) * (v / (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

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

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

Alternative 2: 80.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u \cdot 2}\\ \mathbf{if}\;t1 \leq -6.2 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 3 \cdot 10^{-90}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+26} \lor \neg \left(t1 \leq 6.5 \cdot 10^{+41}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 (* u 2.0)))))
   (if (<= t1 -6.2e-46)
     t_1
     (if (<= t1 3e-90)
       (/ (* v (/ t1 u)) (- u))
       (if (or (<= t1 7.5e+26) (not (<= t1 6.5e+41)))
         t_1
         (* (/ v (+ t1 u)) (/ (- t1) u)))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + (u * 2.0));
	double tmp;
	if (t1 <= -6.2e-46) {
		tmp = t_1;
	} else if (t1 <= 3e-90) {
		tmp = (v * (t1 / u)) / -u;
	} else if ((t1 <= 7.5e+26) || !(t1 <= 6.5e+41)) {
		tmp = t_1;
	} else {
		tmp = (v / (t1 + u)) * (-t1 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / (t1 + (u * 2.0d0))
    if (t1 <= (-6.2d-46)) then
        tmp = t_1
    else if (t1 <= 3d-90) then
        tmp = (v * (t1 / u)) / -u
    else if ((t1 <= 7.5d+26) .or. (.not. (t1 <= 6.5d+41))) then
        tmp = t_1
    else
        tmp = (v / (t1 + u)) * (-t1 / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + (u * 2.0));
	double tmp;
	if (t1 <= -6.2e-46) {
		tmp = t_1;
	} else if (t1 <= 3e-90) {
		tmp = (v * (t1 / u)) / -u;
	} else if ((t1 <= 7.5e+26) || !(t1 <= 6.5e+41)) {
		tmp = t_1;
	} else {
		tmp = (v / (t1 + u)) * (-t1 / u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + (u * 2.0))
	tmp = 0
	if t1 <= -6.2e-46:
		tmp = t_1
	elif t1 <= 3e-90:
		tmp = (v * (t1 / u)) / -u
	elif (t1 <= 7.5e+26) or not (t1 <= 6.5e+41):
		tmp = t_1
	else:
		tmp = (v / (t1 + u)) * (-t1 / u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0)))
	tmp = 0.0
	if (t1 <= -6.2e-46)
		tmp = t_1;
	elseif (t1 <= 3e-90)
		tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u));
	elseif ((t1 <= 7.5e+26) || !(t1 <= 6.5e+41))
		tmp = t_1;
	else
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + (u * 2.0));
	tmp = 0.0;
	if (t1 <= -6.2e-46)
		tmp = t_1;
	elseif (t1 <= 3e-90)
		tmp = (v * (t1 / u)) / -u;
	elseif ((t1 <= 7.5e+26) || ~((t1 <= 6.5e+41)))
		tmp = t_1;
	else
		tmp = (v / (t1 + u)) * (-t1 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -6.2e-46], t$95$1, If[LessEqual[t1, 3e-90], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[Or[LessEqual[t1, 7.5e+26], N[Not[LessEqual[t1, 6.5e+41]], $MachinePrecision]], t$95$1, N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -6.2 \cdot 10^{-46}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t1 \leq 3 \cdot 10^{-90}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\

\mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+26} \lor \neg \left(t1 \leq 6.5 \cdot 10^{+41}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -6.2000000000000002e-46 or 3.0000000000000002e-90 < t1 < 7.49999999999999941e26 or 6.49999999999999975e41 < t1

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{-1 \cdot -1} \cdot \frac{u + t1}{t1}}} \]
      13. metadata-eval95.5%

        \[\leadsto \frac{-v}{\frac{u + t1}{\color{blue}{1}} \cdot \frac{u + t1}{t1}} \]
      14. /-rgt-identity95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000002e-46 < t1 < 3.0000000000000002e-90

    1. Initial program 84.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 78.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg78.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{\frac{t1}{u}} \cdot v}{-u} \]
      8. distribute-lft-neg-out41.7%

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

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

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

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

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

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

        \[\leadsto \frac{v \cdot \color{blue}{\frac{t1}{u}}}{-u} \]
    9. Applied egg-rr84.9%

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

    if 7.49999999999999941e26 < t1 < 6.49999999999999975e41

    1. Initial program 83.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 92.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg92.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -6.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{elif}\;t1 \leq 3 \cdot 10^{-90}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+26} \lor \neg \left(t1 \leq 6.5 \cdot 10^{+41}\right):\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \end{array} \]

Alternative 3: 79.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.65 \cdot 10^{-43} \lor \neg \left(t1 \leq 3.35 \cdot 10^{-90} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+27}\right) \land t1 \leq 2.05 \cdot 10^{+42}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -1.65e-43)
         (not
          (or (<= t1 3.35e-90) (and (not (<= t1 2.3e+27)) (<= t1 2.05e+42)))))
   (/ (- v) (+ t1 u))
   (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.65e-43) || !((t1 <= 3.35e-90) || (!(t1 <= 2.3e+27) && (t1 <= 2.05e+42)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.65d-43)) .or. (.not. (t1 <= 3.35d-90) .or. (.not. (t1 <= 2.3d+27)) .and. (t1 <= 2.05d+42))) then
        tmp = -v / (t1 + u)
    else
        tmp = (-t1 / u) * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.65e-43) || !((t1 <= 3.35e-90) || (!(t1 <= 2.3e+27) && (t1 <= 2.05e+42)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -1.65e-43) or not ((t1 <= 3.35e-90) or (not (t1 <= 2.3e+27) and (t1 <= 2.05e+42))):
		tmp = -v / (t1 + u)
	else:
		tmp = (-t1 / u) * (v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -1.65e-43) || !((t1 <= 3.35e-90) || (!(t1 <= 2.3e+27) && (t1 <= 2.05e+42))))
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	else
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -1.65e-43) || ~(((t1 <= 3.35e-90) || (~((t1 <= 2.3e+27)) && (t1 <= 2.05e+42)))))
		tmp = -v / (t1 + u);
	else
		tmp = (-t1 / u) * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.65e-43], N[Not[Or[LessEqual[t1, 3.35e-90], And[N[Not[LessEqual[t1, 2.3e+27]], $MachinePrecision], LessEqual[t1, 2.05e+42]]]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.65 \cdot 10^{-43} \lor \neg \left(t1 \leq 3.35 \cdot 10^{-90} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+27}\right) \land t1 \leq 2.05 \cdot 10^{+42}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.65000000000000008e-43 or 3.3500000000000002e-90 < t1 < 2.3000000000000001e27 or 2.05e42 < t1

    1. Initial program 71.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around inf 81.8%

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

    if -1.65000000000000008e-43 < t1 < 3.3500000000000002e-90 or 2.3000000000000001e27 < t1 < 2.05e42

    1. Initial program 84.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 79.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg79.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.65 \cdot 10^{-43} \lor \neg \left(t1 \leq 3.35 \cdot 10^{-90} \lor \neg \left(t1 \leq 2.3 \cdot 10^{+27}\right) \land t1 \leq 2.05 \cdot 10^{+42}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]

Alternative 4: 79.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-t1}{u}\\ t_2 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -2.25 \cdot 10^{-45}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\ \;\;\;\;\frac{v}{\frac{u}{t_1}}\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.22 \cdot 10^{+42}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- t1) u)) (t_2 (/ (- v) (+ t1 u))))
   (if (<= t1 -2.25e-45)
     t_2
     (if (<= t1 3.35e-90)
       (/ v (/ u t_1))
       (if (or (<= t1 1.5e+27) (not (<= t1 1.22e+42))) t_2 (* t_1 (/ v u)))))))
double code(double u, double v, double t1) {
	double t_1 = -t1 / u;
	double t_2 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2.25e-45) {
		tmp = t_2;
	} else if (t1 <= 3.35e-90) {
		tmp = v / (u / t_1);
	} else if ((t1 <= 1.5e+27) || !(t1 <= 1.22e+42)) {
		tmp = t_2;
	} else {
		tmp = t_1 * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = -t1 / u
    t_2 = -v / (t1 + u)
    if (t1 <= (-2.25d-45)) then
        tmp = t_2
    else if (t1 <= 3.35d-90) then
        tmp = v / (u / t_1)
    else if ((t1 <= 1.5d+27) .or. (.not. (t1 <= 1.22d+42))) then
        tmp = t_2
    else
        tmp = t_1 * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -t1 / u;
	double t_2 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2.25e-45) {
		tmp = t_2;
	} else if (t1 <= 3.35e-90) {
		tmp = v / (u / t_1);
	} else if ((t1 <= 1.5e+27) || !(t1 <= 1.22e+42)) {
		tmp = t_2;
	} else {
		tmp = t_1 * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -t1 / u
	t_2 = -v / (t1 + u)
	tmp = 0
	if t1 <= -2.25e-45:
		tmp = t_2
	elif t1 <= 3.35e-90:
		tmp = v / (u / t_1)
	elif (t1 <= 1.5e+27) or not (t1 <= 1.22e+42):
		tmp = t_2
	else:
		tmp = t_1 * (v / u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-t1) / u)
	t_2 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -2.25e-45)
		tmp = t_2;
	elseif (t1 <= 3.35e-90)
		tmp = Float64(v / Float64(u / t_1));
	elseif ((t1 <= 1.5e+27) || !(t1 <= 1.22e+42))
		tmp = t_2;
	else
		tmp = Float64(t_1 * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -t1 / u;
	t_2 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -2.25e-45)
		tmp = t_2;
	elseif (t1 <= 3.35e-90)
		tmp = v / (u / t_1);
	elseif ((t1 <= 1.5e+27) || ~((t1 <= 1.22e+42)))
		tmp = t_2;
	else
		tmp = t_1 * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) / u), $MachinePrecision]}, Block[{t$95$2 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2.25e-45], t$95$2, If[LessEqual[t1, 3.35e-90], N[(v / N[(u / t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 1.5e+27], N[Not[LessEqual[t1, 1.22e+42]], $MachinePrecision]], t$95$2, N[(t$95$1 * N[(v / u), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-t1}{u}\\
t_2 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -2.25 \cdot 10^{-45}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\
\;\;\;\;\frac{v}{\frac{u}{t_1}}\\

\mathbf{elif}\;t1 \leq 1.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.22 \cdot 10^{+42}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -2.2499999999999999e-45 or 3.3500000000000002e-90 < t1 < 1.49999999999999988e27 or 1.22e42 < t1

    1. Initial program 71.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around inf 81.8%

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

    if -2.2499999999999999e-45 < t1 < 3.3500000000000002e-90

    1. Initial program 84.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 78.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg78.2%

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    7. Step-by-step derivation
      1. expm1-log1p-u70.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)\right)} \]
      2. expm1-udef51.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)} - 1} \]
    8. Applied egg-rr55.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def73.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)\right)} \]
      2. expm1-log1p83.8%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{t1 - u}}{u}} \]
      3. associate-/l*82.3%

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

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    11. Taylor expanded in t1 around 0 83.4%

      \[\leadsto \frac{v}{\frac{u}{\color{blue}{-1 \cdot \frac{t1}{u}}}} \]
    12. Step-by-step derivation
      1. mul-1-neg83.4%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{-\frac{t1}{u}}}} \]
    13. Simplified83.4%

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

    if 1.49999999999999988e27 < t1 < 1.22e42

    1. Initial program 83.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 92.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg92.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.25 \cdot 10^{-45}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\ \;\;\;\;\frac{v}{\frac{u}{\frac{-t1}{u}}}\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.22 \cdot 10^{+42}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]

Alternative 5: 79.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-t1}{u}\\ t_2 := \frac{-v}{t1 + u \cdot 2}\\ \mathbf{if}\;t1 \leq -3.4 \cdot 10^{-46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{-90}:\\ \;\;\;\;\frac{v}{\frac{u}{t_1}}\\ \mathbf{elif}\;t1 \leq 2.2 \cdot 10^{+27} \lor \neg \left(t1 \leq 7.5 \cdot 10^{+41}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- t1) u)) (t_2 (/ (- v) (+ t1 (* u 2.0)))))
   (if (<= t1 -3.4e-46)
     t_2
     (if (<= t1 2.3e-90)
       (/ v (/ u t_1))
       (if (or (<= t1 2.2e+27) (not (<= t1 7.5e+41))) t_2 (* t_1 (/ v u)))))))
double code(double u, double v, double t1) {
	double t_1 = -t1 / u;
	double t_2 = -v / (t1 + (u * 2.0));
	double tmp;
	if (t1 <= -3.4e-46) {
		tmp = t_2;
	} else if (t1 <= 2.3e-90) {
		tmp = v / (u / t_1);
	} else if ((t1 <= 2.2e+27) || !(t1 <= 7.5e+41)) {
		tmp = t_2;
	} else {
		tmp = t_1 * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = -t1 / u
    t_2 = -v / (t1 + (u * 2.0d0))
    if (t1 <= (-3.4d-46)) then
        tmp = t_2
    else if (t1 <= 2.3d-90) then
        tmp = v / (u / t_1)
    else if ((t1 <= 2.2d+27) .or. (.not. (t1 <= 7.5d+41))) then
        tmp = t_2
    else
        tmp = t_1 * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -t1 / u;
	double t_2 = -v / (t1 + (u * 2.0));
	double tmp;
	if (t1 <= -3.4e-46) {
		tmp = t_2;
	} else if (t1 <= 2.3e-90) {
		tmp = v / (u / t_1);
	} else if ((t1 <= 2.2e+27) || !(t1 <= 7.5e+41)) {
		tmp = t_2;
	} else {
		tmp = t_1 * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -t1 / u
	t_2 = -v / (t1 + (u * 2.0))
	tmp = 0
	if t1 <= -3.4e-46:
		tmp = t_2
	elif t1 <= 2.3e-90:
		tmp = v / (u / t_1)
	elif (t1 <= 2.2e+27) or not (t1 <= 7.5e+41):
		tmp = t_2
	else:
		tmp = t_1 * (v / u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-t1) / u)
	t_2 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0)))
	tmp = 0.0
	if (t1 <= -3.4e-46)
		tmp = t_2;
	elseif (t1 <= 2.3e-90)
		tmp = Float64(v / Float64(u / t_1));
	elseif ((t1 <= 2.2e+27) || !(t1 <= 7.5e+41))
		tmp = t_2;
	else
		tmp = Float64(t_1 * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -t1 / u;
	t_2 = -v / (t1 + (u * 2.0));
	tmp = 0.0;
	if (t1 <= -3.4e-46)
		tmp = t_2;
	elseif (t1 <= 2.3e-90)
		tmp = v / (u / t_1);
	elseif ((t1 <= 2.2e+27) || ~((t1 <= 7.5e+41)))
		tmp = t_2;
	else
		tmp = t_1 * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-t1) / u), $MachinePrecision]}, Block[{t$95$2 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.4e-46], t$95$2, If[LessEqual[t1, 2.3e-90], N[(v / N[(u / t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 2.2e+27], N[Not[LessEqual[t1, 7.5e+41]], $MachinePrecision]], t$95$2, N[(t$95$1 * N[(v / u), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-t1}{u}\\
t_2 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -3.4 \cdot 10^{-46}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{-90}:\\
\;\;\;\;\frac{v}{\frac{u}{t_1}}\\

\mathbf{elif}\;t1 \leq 2.2 \cdot 10^{+27} \lor \neg \left(t1 \leq 7.5 \cdot 10^{+41}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -3.39999999999999996e-46 or 2.2999999999999998e-90 < t1 < 2.1999999999999999e27 or 7.50000000000000072e41 < t1

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{-1 \cdot -1} \cdot \frac{u + t1}{t1}}} \]
      13. metadata-eval95.5%

        \[\leadsto \frac{-v}{\frac{u + t1}{\color{blue}{1}} \cdot \frac{u + t1}{t1}} \]
      14. /-rgt-identity95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.39999999999999996e-46 < t1 < 2.2999999999999998e-90

    1. Initial program 84.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 78.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg78.2%

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    7. Step-by-step derivation
      1. expm1-log1p-u70.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)\right)} \]
      2. expm1-udef51.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)} - 1} \]
    8. Applied egg-rr55.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def73.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)\right)} \]
      2. expm1-log1p83.8%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{t1 - u}}{u}} \]
      3. associate-/l*82.3%

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

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    11. Taylor expanded in t1 around 0 83.4%

      \[\leadsto \frac{v}{\frac{u}{\color{blue}{-1 \cdot \frac{t1}{u}}}} \]
    12. Step-by-step derivation
      1. mul-1-neg83.4%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{-\frac{t1}{u}}}} \]
    13. Simplified83.4%

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

    if 2.1999999999999999e27 < t1 < 7.50000000000000072e41

    1. Initial program 83.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 92.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg92.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.4 \cdot 10^{-46}:\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{-90}:\\ \;\;\;\;\frac{v}{\frac{u}{\frac{-t1}{u}}}\\ \mathbf{elif}\;t1 \leq 2.2 \cdot 10^{+27} \lor \neg \left(t1 \leq 7.5 \cdot 10^{+41}\right):\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]

Alternative 6: 80.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u \cdot 2}\\ \mathbf{if}\;t1 \leq -8.6 \cdot 10^{-49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.15 \cdot 10^{+42}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 (* u 2.0)))))
   (if (<= t1 -8.6e-49)
     t_1
     (if (<= t1 3.35e-90)
       (/ (* v (/ t1 u)) (- u))
       (if (or (<= t1 7.5e+27) (not (<= t1 1.15e+42)))
         t_1
         (* (/ (- t1) u) (/ v u)))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + (u * 2.0));
	double tmp;
	if (t1 <= -8.6e-49) {
		tmp = t_1;
	} else if (t1 <= 3.35e-90) {
		tmp = (v * (t1 / u)) / -u;
	} else if ((t1 <= 7.5e+27) || !(t1 <= 1.15e+42)) {
		tmp = t_1;
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / (t1 + (u * 2.0d0))
    if (t1 <= (-8.6d-49)) then
        tmp = t_1
    else if (t1 <= 3.35d-90) then
        tmp = (v * (t1 / u)) / -u
    else if ((t1 <= 7.5d+27) .or. (.not. (t1 <= 1.15d+42))) then
        tmp = t_1
    else
        tmp = (-t1 / u) * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + (u * 2.0));
	double tmp;
	if (t1 <= -8.6e-49) {
		tmp = t_1;
	} else if (t1 <= 3.35e-90) {
		tmp = (v * (t1 / u)) / -u;
	} else if ((t1 <= 7.5e+27) || !(t1 <= 1.15e+42)) {
		tmp = t_1;
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + (u * 2.0))
	tmp = 0
	if t1 <= -8.6e-49:
		tmp = t_1
	elif t1 <= 3.35e-90:
		tmp = (v * (t1 / u)) / -u
	elif (t1 <= 7.5e+27) or not (t1 <= 1.15e+42):
		tmp = t_1
	else:
		tmp = (-t1 / u) * (v / u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0)))
	tmp = 0.0
	if (t1 <= -8.6e-49)
		tmp = t_1;
	elseif (t1 <= 3.35e-90)
		tmp = Float64(Float64(v * Float64(t1 / u)) / Float64(-u));
	elseif ((t1 <= 7.5e+27) || !(t1 <= 1.15e+42))
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + (u * 2.0));
	tmp = 0.0;
	if (t1 <= -8.6e-49)
		tmp = t_1;
	elseif (t1 <= 3.35e-90)
		tmp = (v * (t1 / u)) / -u;
	elseif ((t1 <= 7.5e+27) || ~((t1 <= 1.15e+42)))
		tmp = t_1;
	else
		tmp = (-t1 / u) * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -8.6e-49], t$95$1, If[LessEqual[t1, 3.35e-90], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[Or[LessEqual[t1, 7.5e+27], N[Not[LessEqual[t1, 1.15e+42]], $MachinePrecision]], t$95$1, N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u \cdot 2}\\
\mathbf{if}\;t1 \leq -8.6 \cdot 10^{-49}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\

\mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.15 \cdot 10^{+42}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -8.60000000000000033e-49 or 3.3500000000000002e-90 < t1 < 7.5000000000000002e27 or 1.15e42 < t1

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{-1 \cdot -1} \cdot \frac{u + t1}{t1}}} \]
      13. metadata-eval95.5%

        \[\leadsto \frac{-v}{\frac{u + t1}{\color{blue}{1}} \cdot \frac{u + t1}{t1}} \]
      14. /-rgt-identity95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.60000000000000033e-49 < t1 < 3.3500000000000002e-90

    1. Initial program 84.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 78.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg78.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{\frac{t1}{u}} \cdot v}{-u} \]
      8. distribute-lft-neg-out41.7%

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

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

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

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

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

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

        \[\leadsto \frac{v \cdot \color{blue}{\frac{t1}{u}}}{-u} \]
    9. Applied egg-rr84.9%

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

    if 7.5000000000000002e27 < t1 < 1.15e42

    1. Initial program 83.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 92.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg92.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -8.6 \cdot 10^{-49}:\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{elif}\;t1 \leq 3.35 \cdot 10^{-90}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 7.5 \cdot 10^{+27} \lor \neg \left(t1 \leq 1.15 \cdot 10^{+42}\right):\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]

Alternative 7: 77.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -5.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \mathbf{elif}\;u \leq 1.5 \cdot 10^{-59}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{v}{\frac{t1 + u}{t1}}}{t1 - u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -5.8e+56)
   (* (/ v (+ t1 u)) (/ (- t1) u))
   (if (<= u 1.5e-59) (- (/ v t1)) (/ (/ v (/ (+ t1 u) t1)) (- t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -5.8e+56) {
		tmp = (v / (t1 + u)) * (-t1 / u);
	} else if (u <= 1.5e-59) {
		tmp = -(v / t1);
	} else {
		tmp = (v / ((t1 + u) / t1)) / (t1 - u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-5.8d+56)) then
        tmp = (v / (t1 + u)) * (-t1 / u)
    else if (u <= 1.5d-59) then
        tmp = -(v / t1)
    else
        tmp = (v / ((t1 + u) / t1)) / (t1 - u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -5.8e+56) {
		tmp = (v / (t1 + u)) * (-t1 / u);
	} else if (u <= 1.5e-59) {
		tmp = -(v / t1);
	} else {
		tmp = (v / ((t1 + u) / t1)) / (t1 - u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -5.8e+56:
		tmp = (v / (t1 + u)) * (-t1 / u)
	elif u <= 1.5e-59:
		tmp = -(v / t1)
	else:
		tmp = (v / ((t1 + u) / t1)) / (t1 - u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -5.8e+56)
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u));
	elseif (u <= 1.5e-59)
		tmp = Float64(-Float64(v / t1));
	else
		tmp = Float64(Float64(v / Float64(Float64(t1 + u) / t1)) / Float64(t1 - u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -5.8e+56)
		tmp = (v / (t1 + u)) * (-t1 / u);
	elseif (u <= 1.5e-59)
		tmp = -(v / t1);
	else
		tmp = (v / ((t1 + u) / t1)) / (t1 - u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -5.8e+56], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.5e-59], (-N[(v / t1), $MachinePrecision]), N[(N[(v / N[(N[(t1 + u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{+56}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\

\mathbf{elif}\;u \leq 1.5 \cdot 10^{-59}:\\
\;\;\;\;-\frac{v}{t1}\\

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


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

    1. Initial program 78.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 87.3%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg87.3%

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

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

    if -5.80000000000000014e56 < u < 1.5e-59

    1. Initial program 74.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)}} \cdot t1 \]
      8. /-rgt-identity75.1%

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{-1 \cdot -1} \cdot \frac{u + t1}{t1}}} \]
      13. metadata-eval99.9%

        \[\leadsto \frac{-v}{\frac{u + t1}{\color{blue}{1}} \cdot \frac{u + t1}{t1}} \]
      14. /-rgt-identity99.9%

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e-59 < u

    1. Initial program 79.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. clear-num97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{v}{\frac{t1 + u}{t1}}}{t1 - u}} \]
    7. Simplified77.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \mathbf{elif}\;u \leq 1.5 \cdot 10^{-59}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{v}{\frac{t1 + u}{t1}}}{t1 - u}\\ \end{array} \]

Alternative 8: 76.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.7 \cdot 10^{+55} \lor \neg \left(u \leq 7.8 \cdot 10^{-60}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.7e+55) (not (<= u 7.8e-60)))
   (/ (* t1 (/ v u)) (- u))
   (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.7e+55) || !(u <= 7.8e-60)) {
		tmp = (t1 * (v / u)) / -u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-2.7d+55)) .or. (.not. (u <= 7.8d-60))) then
        tmp = (t1 * (v / u)) / -u
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.7e+55) || !(u <= 7.8e-60)) {
		tmp = (t1 * (v / u)) / -u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.7e+55) or not (u <= 7.8e-60):
		tmp = (t1 * (v / u)) / -u
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.7e+55) || !(u <= 7.8e-60))
		tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u));
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.7e+55) || ~((u <= 7.8e-60)))
		tmp = (t1 * (v / u)) / -u;
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.7e+55], N[Not[LessEqual[u, 7.8e-60]], $MachinePrecision]], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.7 \cdot 10^{+55} \lor \neg \left(u \leq 7.8 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.69999999999999977e55 or 7.8000000000000004e-60 < u

    1. Initial program 78.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 81.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg81.1%

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

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

      \[\leadsto \left(-\frac{t1}{u}\right) \cdot \color{blue}{\frac{v}{u}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt48.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-t1}{-u}} \cdot \frac{v}{u} \]
      7. associate-*l/50.2%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{t1} \cdot \frac{v}{u}}{-u} \]
    9. Applied egg-rr79.5%

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

    if -2.69999999999999977e55 < u < 7.8000000000000004e-60

    1. Initial program 74.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)}} \cdot t1 \]
      8. /-rgt-identity75.1%

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{-1 \cdot -1} \cdot \frac{u + t1}{t1}}} \]
      13. metadata-eval99.9%

        \[\leadsto \frac{-v}{\frac{u + t1}{\color{blue}{1}} \cdot \frac{u + t1}{t1}} \]
      14. /-rgt-identity99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.7 \cdot 10^{+55} \lor \neg \left(u \leq 7.8 \cdot 10^{-60}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]

Alternative 9: 66.9% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.8 \cdot 10^{+216} \lor \neg \left(u \leq 2.1 \cdot 10^{+161}\right):\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.8e+216) (not (<= u 2.1e+161)))
   (* v (/ (/ t1 u) u))
   (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.8e+216) || !(u <= 2.1e+161)) {
		tmp = v * ((t1 / u) / u);
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-1.8d+216)) .or. (.not. (u <= 2.1d+161))) then
        tmp = v * ((t1 / u) / u)
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.8e+216) || !(u <= 2.1e+161)) {
		tmp = v * ((t1 / u) / u);
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.8e+216) or not (u <= 2.1e+161):
		tmp = v * ((t1 / u) / u)
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.8e+216) || !(u <= 2.1e+161))
		tmp = Float64(v * Float64(Float64(t1 / u) / u));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -1.8e+216) || ~((u <= 2.1e+161)))
		tmp = v * ((t1 / u) / u);
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.8e+216], N[Not[LessEqual[u, 2.1e+161]], $MachinePrecision]], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.8 \cdot 10^{+216} \lor \neg \left(u \leq 2.1 \cdot 10^{+161}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.8000000000000001e216 or 2.1e161 < u

    1. Initial program 83.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 97.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg97.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1}}{\frac{u}{v} \cdot u} \]
      6. add-sqr-sqrt47.1%

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{v} \cdot u} \]
      9. sqrt-unprod38.1%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{v} \cdot u} \]
      10. add-sqr-sqrt83.1%

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{\frac{u}{v}}}{u}} \]
      2. add-sqr-sqrt47.2%

        \[\leadsto \frac{\frac{t1}{\frac{u}{v}}}{\color{blue}{\sqrt{u} \cdot \sqrt{u}}} \]
      3. sqrt-unprod83.3%

        \[\leadsto \frac{\frac{t1}{\frac{u}{v}}}{\color{blue}{\sqrt{u \cdot u}}} \]
      4. sqr-neg83.3%

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

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

        \[\leadsto \frac{\frac{t1}{\frac{u}{v}}}{\color{blue}{-u}} \]
      7. associate-/r*93.3%

        \[\leadsto \color{blue}{\frac{t1}{\frac{u}{v} \cdot \left(-u\right)}} \]
      8. associate-/l/97.9%

        \[\leadsto \color{blue}{\frac{\frac{t1}{-u}}{\frac{u}{v}}} \]
      9. associate-/r/85.6%

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

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{-u} \cdot \sqrt{-u}}}}{u} \cdot v \]
      11. sqrt-unprod83.3%

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

        \[\leadsto \frac{\frac{t1}{\sqrt{\color{blue}{u \cdot u}}}}{u} \cdot v \]
      13. sqrt-unprod47.3%

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

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

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

    if -1.8000000000000001e216 < u < 2.1e161

    1. Initial program 75.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around inf 66.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.8 \cdot 10^{+216} \lor \neg \left(u \leq 2.1 \cdot 10^{+161}\right):\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]

Alternative 10: 68.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -8.5 \cdot 10^{+100}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.8 \cdot 10^{+161}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -8.5e+100)
   (/ t1 (* u (/ u v)))
   (if (<= u 1.8e+161) (/ (- v) (+ t1 u)) (* v (/ (/ t1 u) u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -8.5e+100) {
		tmp = t1 / (u * (u / v));
	} else if (u <= 1.8e+161) {
		tmp = -v / (t1 + u);
	} else {
		tmp = v * ((t1 / u) / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-8.5d+100)) then
        tmp = t1 / (u * (u / v))
    else if (u <= 1.8d+161) then
        tmp = -v / (t1 + u)
    else
        tmp = v * ((t1 / u) / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -8.5e+100) {
		tmp = t1 / (u * (u / v));
	} else if (u <= 1.8e+161) {
		tmp = -v / (t1 + u);
	} else {
		tmp = v * ((t1 / u) / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -8.5e+100:
		tmp = t1 / (u * (u / v))
	elif u <= 1.8e+161:
		tmp = -v / (t1 + u)
	else:
		tmp = v * ((t1 / u) / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -8.5e+100)
		tmp = Float64(t1 / Float64(u * Float64(u / v)));
	elseif (u <= 1.8e+161)
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	else
		tmp = Float64(v * Float64(Float64(t1 / u) / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -8.5e+100)
		tmp = t1 / (u * (u / v));
	elseif (u <= 1.8e+161)
		tmp = -v / (t1 + u);
	else
		tmp = v * ((t1 / u) / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -8.5e+100], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.8e+161], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+100}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\

\mathbf{elif}\;u \leq 1.8 \cdot 10^{+161}:\\
\;\;\;\;\frac{-v}{t1 + u}\\

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


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

    1. Initial program 73.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 89.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg89.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1}}{\frac{u}{v} \cdot u} \]
      6. add-sqr-sqrt50.6%

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{v} \cdot u} \]
      10. add-sqr-sqrt62.1%

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

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

    if -8.50000000000000043e100 < u < 1.79999999999999992e161

    1. Initial program 76.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around inf 70.0%

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

    if 1.79999999999999992e161 < u

    1. Initial program 85.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 99.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{v} \cdot u} \]
      10. add-sqr-sqrt85.3%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{v} \cdot u} \]
    9. Applied egg-rr85.3%

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{\frac{u}{v}}}{u}} \]
      2. add-sqr-sqrt85.3%

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

        \[\leadsto \frac{\frac{t1}{\frac{u}{v}}}{\color{blue}{\sqrt{u \cdot u}}} \]
      4. sqr-neg85.5%

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

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

        \[\leadsto \frac{\frac{t1}{\frac{u}{v}}}{\color{blue}{-u}} \]
      7. associate-/r*99.8%

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{-u}}{\frac{u}{v}}} \]
      9. associate-/r/88.2%

        \[\leadsto \color{blue}{\frac{\frac{t1}{-u}}{u} \cdot v} \]
      10. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{-u} \cdot \sqrt{-u}}}}{u} \cdot v \]
      11. sqrt-unprod85.5%

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

        \[\leadsto \frac{\frac{t1}{\sqrt{\color{blue}{u \cdot u}}}}{u} \cdot v \]
      13. sqrt-unprod85.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -8.5 \cdot 10^{+100}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.8 \cdot 10^{+161}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\ \end{array} \]

Alternative 11: 68.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -6.5 \cdot 10^{+100}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 2 \cdot 10^{+161}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -6.5e+100)
   (/ t1 (* u (/ u v)))
   (if (<= u 2e+161) (/ (- v) (+ t1 u)) (/ v (* u (/ u t1))))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -6.5e+100) {
		tmp = t1 / (u * (u / v));
	} else if (u <= 2e+161) {
		tmp = -v / (t1 + u);
	} else {
		tmp = v / (u * (u / t1));
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-6.5d+100)) then
        tmp = t1 / (u * (u / v))
    else if (u <= 2d+161) then
        tmp = -v / (t1 + u)
    else
        tmp = v / (u * (u / t1))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -6.5e+100) {
		tmp = t1 / (u * (u / v));
	} else if (u <= 2e+161) {
		tmp = -v / (t1 + u);
	} else {
		tmp = v / (u * (u / t1));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -6.5e+100:
		tmp = t1 / (u * (u / v))
	elif u <= 2e+161:
		tmp = -v / (t1 + u)
	else:
		tmp = v / (u * (u / t1))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -6.5e+100)
		tmp = Float64(t1 / Float64(u * Float64(u / v)));
	elseif (u <= 2e+161)
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	else
		tmp = Float64(v / Float64(u * Float64(u / t1)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -6.5e+100)
		tmp = t1 / (u * (u / v));
	elseif (u <= 2e+161)
		tmp = -v / (t1 + u);
	else
		tmp = v / (u * (u / t1));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -6.5e+100], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2e+161], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v / N[(u * N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.5 \cdot 10^{+100}:\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\

\mathbf{elif}\;u \leq 2 \cdot 10^{+161}:\\
\;\;\;\;\frac{-v}{t1 + u}\\

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


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

    1. Initial program 73.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 89.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg89.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1}}{\frac{u}{v} \cdot u} \]
      6. add-sqr-sqrt50.6%

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{v} \cdot u} \]
      10. add-sqr-sqrt62.1%

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

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

    if -6.50000000000000001e100 < u < 2.0000000000000001e161

    1. Initial program 76.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around inf 70.0%

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

    if 2.0000000000000001e161 < u

    1. Initial program 85.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 99.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg99.9%

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

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

      \[\leadsto \left(-\frac{t1}{u}\right) \cdot \color{blue}{\frac{v}{u}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt69.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{t1}{u}} \cdot \frac{v}{u} \]
      6. clear-num85.3%

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

        \[\leadsto \color{blue}{\frac{1 \cdot v}{\frac{u}{t1} \cdot u}} \]
      8. *-un-lft-identity85.5%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{t1} \cdot u} \]
    9. Applied egg-rr85.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -6.5 \cdot 10^{+100}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 2 \cdot 10^{+161}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\ \end{array} \]

Alternative 12: 58.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -8.5 \cdot 10^{+123} \lor \neg \left(u \leq 1.82 \cdot 10^{+161}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -8.5e+123) (not (<= u 1.82e+161))) (/ v u) (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -8.5e+123) || !(u <= 1.82e+161)) {
		tmp = v / u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-8.5d+123)) .or. (.not. (u <= 1.82d+161))) then
        tmp = v / u
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -8.5e+123) || !(u <= 1.82e+161)) {
		tmp = v / u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -8.5e+123) or not (u <= 1.82e+161):
		tmp = v / u
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -8.5e+123) || !(u <= 1.82e+161))
		tmp = Float64(v / u);
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -8.5e+123) || ~((u <= 1.82e+161)))
		tmp = v / u;
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -8.5e+123], N[Not[LessEqual[u, 1.82e+161]], $MachinePrecision]], N[(v / u), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+123} \lor \neg \left(u \leq 1.82 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -8.5e123 or 1.81999999999999991e161 < u

    1. Initial program 75.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 93.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg93.9%

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    7. Step-by-step derivation
      1. expm1-log1p-u93.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)\right)} \]
      2. expm1-udef74.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)} - 1} \]
    8. Applied egg-rr74.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def93.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)\right)} \]
      2. expm1-log1p93.9%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{t1 - u}}{u}} \]
      3. associate-/l*80.3%

        \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    10. Simplified80.3%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
    11. Taylor expanded in u around 0 40.8%

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

    if -8.5e123 < u < 1.81999999999999991e161

    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. +-commutative77.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{-1 \cdot -1} \cdot \frac{u + t1}{t1}}} \]
      13. metadata-eval98.4%

        \[\leadsto \frac{-v}{\frac{u + t1}{\color{blue}{1}} \cdot \frac{u + t1}{t1}} \]
      14. /-rgt-identity98.4%

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

        \[\leadsto \frac{-v}{\color{blue}{\left(t1 + u\right)} \cdot \frac{u + t1}{t1}} \]
      16. remove-double-neg98.4%

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

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

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

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

        \[\leadsto \frac{-v}{\left(t1 + u\right) \cdot \left(\frac{u}{t1} + \color{blue}{\frac{-\left(-t1\right)}{t1}}\right)} \]
      21. remove-double-neg98.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -8.5 \cdot 10^{+123} \lor \neg \left(u \leq 1.82 \cdot 10^{+161}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]

Alternative 13: 58.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3 \cdot 10^{+123} \lor \neg \left(u \leq 1.75 \cdot 10^{+161}\right):\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -3e+123) (not (<= u 1.75e+161))) (/ (- v) u) (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3e+123) || !(u <= 1.75e+161)) {
		tmp = -v / u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-3d+123)) .or. (.not. (u <= 1.75d+161))) then
        tmp = -v / u
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3e+123) || !(u <= 1.75e+161)) {
		tmp = -v / u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3e+123) or not (u <= 1.75e+161):
		tmp = -v / u
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3e+123) || !(u <= 1.75e+161))
		tmp = Float64(Float64(-v) / u);
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -3e+123) || ~((u <= 1.75e+161)))
		tmp = -v / u;
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3e+123], N[Not[LessEqual[u, 1.75e+161]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3 \cdot 10^{+123} \lor \neg \left(u \leq 1.75 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{-v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.00000000000000008e123 or 1.74999999999999994e161 < u

    1. Initial program 75.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 94.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg94.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    9. Simplified40.5%

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

    if -3.00000000000000008e123 < u < 1.74999999999999994e161

    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. +-commutative77.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{-1 \cdot -1} \cdot \frac{u + t1}{t1}}} \]
      13. metadata-eval98.4%

        \[\leadsto \frac{-v}{\frac{u + t1}{\color{blue}{1}} \cdot \frac{u + t1}{t1}} \]
      14. /-rgt-identity98.4%

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

        \[\leadsto \frac{-v}{\color{blue}{\left(t1 + u\right)} \cdot \frac{u + t1}{t1}} \]
      16. remove-double-neg98.4%

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

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

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

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

        \[\leadsto \frac{-v}{\left(t1 + u\right) \cdot \left(\frac{u}{t1} + \color{blue}{\frac{-\left(-t1\right)}{t1}}\right)} \]
      21. remove-double-neg98.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3 \cdot 10^{+123} \lor \neg \left(u \leq 1.75 \cdot 10^{+161}\right):\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]

Alternative 14: 61.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{-v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
	return -v / (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 = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
	return -v / (t1 + u);
}
def code(u, v, t1):
	return -v / (t1 + u)
function code(u, v, t1)
	return Float64(Float64(-v) / Float64(t1 + u))
end
function tmp = code(u, v, t1)
	tmp = -v / (t1 + u);
end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-v}{t1 + u}
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Taylor expanded in t1 around inf 63.1%

    \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
  5. Final simplification63.1%

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

Alternative 15: 17.0% accurate, 4.0× speedup?

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

\\
\frac{v}{u}
\end{array}
Derivation
  1. Initial program 76.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Taylor expanded in t1 around 0 51.7%

    \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
  5. Step-by-step derivation
    1. mul-1-neg51.7%

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

    \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
  7. Step-by-step derivation
    1. expm1-log1p-u48.6%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)\right)} \]
    2. expm1-udef35.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{t1}{u}\right) \cdot \frac{v}{t1 + u}\right)} - 1} \]
  8. Applied egg-rr39.1%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)} - 1} \]
  9. Step-by-step derivation
    1. expm1-def47.2%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v \cdot \frac{t1}{t1 - u}}{u}\right)\right)} \]
    2. expm1-log1p51.5%

      \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{t1 - u}}{u}} \]
    3. associate-/l*47.9%

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

    \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{t1 - u}}}} \]
  11. Taylor expanded in u around 0 15.8%

    \[\leadsto \frac{v}{\color{blue}{u}} \]
  12. Final simplification15.8%

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

Reproduce

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