Rosa's DopplerBench

Percentage Accurate: 72.0% → 97.8%
Time: 11.8s
Alternatives: 12
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 72.0% 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: 97.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 77.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -5 \cdot 10^{+45} \lor \neg \left(u \leq 4.6 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u + t1}}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -5e+45) (not (<= u 4.6e+67)))
   (/ (* t1 (/ (- v) (+ u t1))) u)
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -5e+45) || !(u <= 4.6e+67)) {
		tmp = (t1 * (-v / (u + t1))) / 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 <= (-5d+45)) .or. (.not. (u <= 4.6d+67))) then
        tmp = (t1 * (-v / (u + t1))) / 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 <= -5e+45) || !(u <= 4.6e+67)) {
		tmp = (t1 * (-v / (u + t1))) / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -5e+45) or not (u <= 4.6e+67):
		tmp = (t1 * (-v / (u + t1))) / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -5e+45) || !(u <= 4.6e+67))
		tmp = Float64(Float64(t1 * Float64(Float64(-v) / Float64(u + t1))) / u);
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -5e+45) || ~((u <= 4.6e+67)))
		tmp = (t1 * (-v / (u + t1))) / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5e+45], N[Not[LessEqual[u, 4.6e+67]], $MachinePrecision]], N[(N[(t1 * N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5 \cdot 10^{+45} \lor \neg \left(u \leq 4.6 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{-v}{u + t1}}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5e45 or 4.5999999999999997e67 < u

    1. Initial program 74.5%

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

        \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{\left(u + t1\right)} \cdot \left(t1 + u\right)} \]
      2. +-commutative74.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 0 85.9%

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

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

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

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

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

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

    if -5e45 < u < 4.5999999999999997e67

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\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 80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5 \cdot 10^{+45} \lor \neg \left(u \leq 4.6 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u + t1}}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 3: 74.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.25 \cdot 10^{+119}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{elif}\;u \leq 4.8 \cdot 10^{+67}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u + t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.25e+119)
   (/ (* t1 (/ (- v) u)) u)
   (if (<= u 4.8e+67) (/ (- v) t1) (* (/ t1 u) (/ (- v) (+ u t1))))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.25e+119) {
		tmp = (t1 * (-v / u)) / u;
	} else if (u <= 4.8e+67) {
		tmp = -v / t1;
	} else {
		tmp = (t1 / u) * (-v / (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 <= (-1.25d+119)) then
        tmp = (t1 * (-v / u)) / u
    else if (u <= 4.8d+67) then
        tmp = -v / t1
    else
        tmp = (t1 / u) * (-v / (u + t1))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.25e+119) {
		tmp = (t1 * (-v / u)) / u;
	} else if (u <= 4.8e+67) {
		tmp = -v / t1;
	} else {
		tmp = (t1 / u) * (-v / (u + t1));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.25e+119:
		tmp = (t1 * (-v / u)) / u
	elif u <= 4.8e+67:
		tmp = -v / t1
	else:
		tmp = (t1 / u) * (-v / (u + t1))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.25e+119)
		tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u);
	elseif (u <= 4.8e+67)
		tmp = Float64(Float64(-v) / t1);
	else
		tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / Float64(u + t1)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.25e+119)
		tmp = (t1 * (-v / u)) / u;
	elseif (u <= 4.8e+67)
		tmp = -v / t1;
	else
		tmp = (t1 / u) * (-v / (u + t1));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.25e+119], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[u, 4.8e+67], N[((-v) / t1), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    7. Step-by-step derivation
      1. distribute-neg-frac92.0%

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

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

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

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

    if -1.25e119 < u < 4.80000000000000004e67

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\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 78.7%

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

    if 4.80000000000000004e67 < u

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.25 \cdot 10^{+119}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{elif}\;u \leq 4.8 \cdot 10^{+67}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u + t1}\\ \end{array} \]

Alternative 4: 76.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.1 \cdot 10^{+47}:\\ \;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(\left(-t1\right) - u\right)}\\ \mathbf{elif}\;u \leq 4.6 \cdot 10^{+67}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u + t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -2.1e+47)
   (/ t1 (* (/ u v) (- (- t1) u)))
   (if (<= u 4.6e+67) (/ (- v) t1) (* (/ t1 u) (/ (- v) (+ u t1))))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.1e+47) {
		tmp = t1 / ((u / v) * (-t1 - u));
	} else if (u <= 4.6e+67) {
		tmp = -v / t1;
	} else {
		tmp = (t1 / u) * (-v / (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 <= (-2.1d+47)) then
        tmp = t1 / ((u / v) * (-t1 - u))
    else if (u <= 4.6d+67) then
        tmp = -v / t1
    else
        tmp = (t1 / u) * (-v / (u + t1))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.1e+47) {
		tmp = t1 / ((u / v) * (-t1 - u));
	} else if (u <= 4.6e+67) {
		tmp = -v / t1;
	} else {
		tmp = (t1 / u) * (-v / (u + t1));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -2.1e+47:
		tmp = t1 / ((u / v) * (-t1 - u))
	elif u <= 4.6e+67:
		tmp = -v / t1
	else:
		tmp = (t1 / u) * (-v / (u + t1))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -2.1e+47)
		tmp = Float64(t1 / Float64(Float64(u / v) * Float64(Float64(-t1) - u)));
	elseif (u <= 4.6e+67)
		tmp = Float64(Float64(-v) / t1);
	else
		tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / Float64(u + t1)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -2.1e+47)
		tmp = t1 / ((u / v) * (-t1 - u));
	elseif (u <= 4.6e+67)
		tmp = -v / t1;
	else
		tmp = (t1 / u) * (-v / (u + t1));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -2.1e+47], N[(t1 / N[(N[(u / v), $MachinePrecision] * N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.6e+67], N[((-v) / t1), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 70.9%

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{t1}{u + t1} \cdot \frac{v}{u + t1}} \]
      6. distribute-rgt-neg-in96.2%

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

        \[\leadsto \frac{t1}{u + t1} \cdot \color{blue}{\frac{-v}{u + t1}} \]
      8. associate-/r/92.1%

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

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

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

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

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

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

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

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

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

    if -2.1e47 < u < 4.5999999999999997e67

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\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 80.8%

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

    if 4.5999999999999997e67 < u

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

      \[\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}\;u \leq -2.1 \cdot 10^{+47}:\\ \;\;\;\;\frac{t1}{\frac{u}{v} \cdot \left(\left(-t1\right) - u\right)}\\ \mathbf{elif}\;u \leq 4.6 \cdot 10^{+67}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u + t1}\\ \end{array} \]

Alternative 5: 95.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1 \cdot 10^{+128}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(u + t1\right) \cdot \left(-1 - \frac{u}{t1}\right)}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1e+128)
   (/ (* t1 (/ (- v) u)) u)
   (/ v (* (+ u t1) (- -1.0 (/ u t1))))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1e+128) {
		tmp = (t1 * (-v / u)) / u;
	} else {
		tmp = v / ((u + t1) * (-1.0 - (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 <= (-1d+128)) then
        tmp = (t1 * (-v / u)) / u
    else
        tmp = v / ((u + t1) * ((-1.0d0) - (u / t1)))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1e+128) {
		tmp = (t1 * (-v / u)) / u;
	} else {
		tmp = v / ((u + t1) * (-1.0 - (u / t1)));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1e+128:
		tmp = (t1 * (-v / u)) / u
	else:
		tmp = v / ((u + t1) * (-1.0 - (u / t1)))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1e+128)
		tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u);
	else
		tmp = Float64(v / Float64(Float64(u + t1) * Float64(-1.0 - Float64(u / t1))));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1e+128)
		tmp = (t1 * (-v / u)) / u;
	else
		tmp = v / ((u + t1) * (-1.0 - (u / t1)));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1e+128], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], N[(v / N[(N[(u + t1), $MachinePrecision] * N[(-1.0 - N[(u / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.0000000000000001e128

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    7. Step-by-step derivation
      1. distribute-neg-frac91.8%

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

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

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

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

    if -1.0000000000000001e128 < u

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-v}{\frac{\frac{\left(u + t1\right) \cdot \left(u + t1\right)}{-1 \cdot -1}}{t1}}} \]
      11. associate-/r*73.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-frac96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{-v}{t1 + u}}{\frac{u}{t1} + 1}} \]
    7. Step-by-step derivation
      1. frac-2neg98.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{t1 + u}}}{-1 + \left(-\frac{u}{t1}\right)} \]
      3. associate-/l/96.5%

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

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

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

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

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

Alternative 6: 73.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -3.8e+118) (not (<= u 6e+67)))
   (* (/ v u) (/ (- t1) u))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.8e+118) || !(u <= 6e+67)) {
		tmp = (v / u) * (-t1 / 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 <= (-3.8d+118)) .or. (.not. (u <= 6d+67))) then
        tmp = (v / u) * (-t1 / 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 <= -3.8e+118) || !(u <= 6e+67)) {
		tmp = (v / u) * (-t1 / u);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3.8e+118) or not (u <= 6e+67):
		tmp = (v / u) * (-t1 / u)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3.8e+118) || !(u <= 6e+67))
		tmp = Float64(Float64(v / u) * Float64(Float64(-t1) / u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -3.8e+118) || ~((u <= 6e+67)))
		tmp = (v / u) * (-t1 / u);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.8e+118], N[Not[LessEqual[u, 6e+67]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.80000000000000016e118 or 6.0000000000000002e67 < u

    1. Initial program 75.4%

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000016e118 < u < 6.0000000000000002e67

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\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 78.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 7: 74.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\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 -3.8e+118) (not (<= u 6e+67)))
   (/ (* t1 (/ (- v) u)) u)
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.8e+118) || !(u <= 6e+67)) {
		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 <= (-3.8d+118)) .or. (.not. (u <= 6d+67))) 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 <= -3.8e+118) || !(u <= 6e+67)) {
		tmp = (t1 * (-v / u)) / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3.8e+118) or not (u <= 6e+67):
		tmp = (t1 * (-v / u)) / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3.8e+118) || !(u <= 6e+67))
		tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u);
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -3.8e+118) || ~((u <= 6e+67)))
		tmp = (t1 * (-v / u)) / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.8e+118], N[Not[LessEqual[u, 6e+67]], $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 -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\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 < -3.80000000000000016e118 or 6.0000000000000002e67 < u

    1. Initial program 75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000016e118 < u < 6.0000000000000002e67

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\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 78.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.8 \cdot 10^{+118} \lor \neg \left(u \leq 6 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 8: 66.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -6.9 \cdot 10^{+126} \lor \neg \left(u \leq 3.8 \cdot 10^{+74}\right):\\ \;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -6.9e+126) (not (<= u 3.8e+74)))
   (* (/ v u) (/ t1 u))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -6.9e+126) || !(u <= 3.8e+74)) {
		tmp = (v / u) * (t1 / 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 <= (-6.9d+126)) .or. (.not. (u <= 3.8d+74))) then
        tmp = (v / u) * (t1 / 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 <= -6.9e+126) || !(u <= 3.8e+74)) {
		tmp = (v / u) * (t1 / u);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -6.9e+126) or not (u <= 3.8e+74):
		tmp = (v / u) * (t1 / u)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -6.9e+126) || !(u <= 3.8e+74))
		tmp = Float64(Float64(v / u) * Float64(t1 / u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -6.9e+126) || ~((u <= 3.8e+74)))
		tmp = (v / u) * (t1 / u);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6.9e+126], N[Not[LessEqual[u, 3.8e+74]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.9 \cdot 10^{+126} \lor \neg \left(u \leq 3.8 \cdot 10^{+74}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -6.8999999999999996e126 or 3.7999999999999998e74 < u

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8999999999999996e126 < u < 3.7999999999999998e74

    1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\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 77.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -6.9 \cdot 10^{+126} \lor \neg \left(u \leq 3.8 \cdot 10^{+74}\right):\\ \;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 9: 58.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -8.2 \cdot 10^{+131} \lor \neg \left(u \leq 1.65 \cdot 10^{+136}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -8.2e+131) (not (<= u 1.65e+136))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -8.2e+131) || !(u <= 1.65e+136)) {
		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.2d+131)) .or. (.not. (u <= 1.65d+136))) 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.2e+131) || !(u <= 1.65e+136)) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -8.2e+131) or not (u <= 1.65e+136):
		tmp = v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -8.2e+131) || !(u <= 1.65e+136))
		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.2e+131) || ~((u <= 1.65e+136)))
		tmp = v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -8.2e+131], N[Not[LessEqual[u, 1.65e+136]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.2 \cdot 10^{+131} \lor \neg \left(u \leq 1.65 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -8.20000000000000015e131 or 1.64999999999999996e136 < u

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    7. Step-by-step derivation
      1. distribute-neg-frac94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 - u}{t1}}}}{u} \]
    13. Taylor expanded in t1 around inf 39.7%

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

    if -8.20000000000000015e131 < u < 1.64999999999999996e136

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -8.2 \cdot 10^{+131} \lor \neg \left(u \leq 1.65 \cdot 10^{+136}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 10: 23.6% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6 \cdot 10^{+163} \lor \neg \left(t1 \leq 1.5 \cdot 10^{+119}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -6.00000000000000027e163 or 1.50000000000000001e119 < t1

    1. Initial program 42.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-neg38.5%

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

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

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

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

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

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

    if -6.00000000000000027e163 < t1 < 1.50000000000000001e119

    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-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 0 63.4%

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

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    7. Step-by-step derivation
      1. distribute-neg-frac63.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 - u}{t1}}}}{u} \]
    13. Taylor expanded in t1 around inf 18.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -6 \cdot 10^{+163} \lor \neg \left(t1 \leq 1.5 \cdot 10^{+119}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]

Alternative 11: 61.8% accurate, 2.0× speedup?

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{t1}{u + t1} \cdot \frac{v}{u + t1}} \]
    6. distribute-rgt-neg-in98.1%

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

      \[\leadsto \frac{t1}{u + t1} \cdot \color{blue}{\frac{-v}{u + t1}} \]
    8. associate-/r/85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 14.2% accurate, 4.0× speedup?

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

\\
\frac{v}{t1}
\end{array}
Derivation
  1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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-neg48.2%

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

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

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

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

      \[\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-neg44.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  7. Final simplification12.6%

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

Reproduce

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