Rosa's DopplerBench

Percentage Accurate: 73.6% → 98.1%
Time: 19.0s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 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: 73.6% accurate, 1.0× speedup?

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

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

Alternative 1: 98.1% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-u\right) - t1\\ t_2 := \frac{v}{t\_1}\\ \mathbf{if}\;t1 \leq -2 \cdot 10^{+122}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t1 \leq 1.55 \cdot 10^{-211}:\\ \;\;\;\;t1 \cdot \frac{t\_2}{t1 + u}\\ \mathbf{elif}\;t1 \leq 4.3 \cdot 10^{+154}:\\ \;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (- (- u) t1)) (t_2 (/ v t_1)))
   (if (<= t1 -2e+122)
     t_2
     (if (<= t1 1.55e-211)
       (* t1 (/ t_2 (+ t1 u)))
       (if (<= t1 4.3e+154) (* v (/ t1 (* (+ t1 u) t_1))) (/ v (- t1)))))))
double code(double u, double v, double t1) {
	double t_1 = -u - t1;
	double t_2 = v / t_1;
	double tmp;
	if (t1 <= -2e+122) {
		tmp = t_2;
	} else if (t1 <= 1.55e-211) {
		tmp = t1 * (t_2 / (t1 + u));
	} else if (t1 <= 4.3e+154) {
		tmp = v * (t1 / ((t1 + u) * t_1));
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = -u - t1
    t_2 = v / t_1
    if (t1 <= (-2d+122)) then
        tmp = t_2
    else if (t1 <= 1.55d-211) then
        tmp = t1 * (t_2 / (t1 + u))
    else if (t1 <= 4.3d+154) then
        tmp = v * (t1 / ((t1 + u) * t_1))
    else
        tmp = v / -t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -u - t1;
	double t_2 = v / t_1;
	double tmp;
	if (t1 <= -2e+122) {
		tmp = t_2;
	} else if (t1 <= 1.55e-211) {
		tmp = t1 * (t_2 / (t1 + u));
	} else if (t1 <= 4.3e+154) {
		tmp = v * (t1 / ((t1 + u) * t_1));
	} else {
		tmp = v / -t1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -u - t1
	t_2 = v / t_1
	tmp = 0
	if t1 <= -2e+122:
		tmp = t_2
	elif t1 <= 1.55e-211:
		tmp = t1 * (t_2 / (t1 + u))
	elif t1 <= 4.3e+154:
		tmp = v * (t1 / ((t1 + u) * t_1))
	else:
		tmp = v / -t1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-u) - t1)
	t_2 = Float64(v / t_1)
	tmp = 0.0
	if (t1 <= -2e+122)
		tmp = t_2;
	elseif (t1 <= 1.55e-211)
		tmp = Float64(t1 * Float64(t_2 / Float64(t1 + u)));
	elseif (t1 <= 4.3e+154)
		tmp = Float64(v * Float64(t1 / Float64(Float64(t1 + u) * t_1)));
	else
		tmp = Float64(v / Float64(-t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -u - t1;
	t_2 = v / t_1;
	tmp = 0.0;
	if (t1 <= -2e+122)
		tmp = t_2;
	elseif (t1 <= 1.55e-211)
		tmp = t1 * (t_2 / (t1 + u));
	elseif (t1 <= 4.3e+154)
		tmp = v * (t1 / ((t1 + u) * t_1));
	else
		tmp = v / -t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-u) - t1), $MachinePrecision]}, Block[{t$95$2 = N[(v / t$95$1), $MachinePrecision]}, If[LessEqual[t1, -2e+122], t$95$2, If[LessEqual[t1, 1.55e-211], N[(t1 * N[(t$95$2 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 4.3e+154], N[(v * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t1 \leq 1.55 \cdot 10^{-211}:\\
\;\;\;\;t1 \cdot \frac{t\_2}{t1 + u}\\

\mathbf{elif}\;t1 \leq 4.3 \cdot 10^{+154}:\\
\;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -2.00000000000000003e122

    1. Initial program 44.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr100.0%

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

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

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

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

    if -2.00000000000000003e122 < t1 < 1.54999999999999998e-211

    1. Initial program 82.3%

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

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

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

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

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

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

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

    if 1.54999999999999998e-211 < t1 < 4.2999999999999998e154

    1. Initial program 87.0%

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

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

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

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

    if 4.2999999999999998e154 < t1

    1. Initial program 24.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+154}:\\
\;\;\;\;t1 \cdot \frac{t\_1}{t1 + u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -4.59999999999999985e120

    1. Initial program 44.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr100.0%

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

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

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

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

    if -4.59999999999999985e120 < t1 < 5.5000000000000006e154

    1. Initial program 84.1%

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

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

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

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

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

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

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

    if 5.5000000000000006e154 < t1

    1. Initial program 24.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t1 \cdot \frac{v}{u}\\ t_2 := \left(-u\right) - t1\\ \mathbf{if}\;u \leq -1.7 \cdot 10^{+42}:\\ \;\;\;\;\frac{t\_1}{t\_2}\\ \mathbf{elif}\;u \leq 2.7 \cdot 10^{+16}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{t\_2}}{t1}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \frac{-1}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* t1 (/ v u))) (t_2 (- (- u) t1)))
   (if (<= u -1.7e+42)
     (/ t_1 t_2)
     (if (<= u 2.7e+16) (/ (* v (/ t1 t_2)) t1) (* t_1 (/ -1.0 u))))))
double code(double u, double v, double t1) {
	double t_1 = t1 * (v / u);
	double t_2 = -u - t1;
	double tmp;
	if (u <= -1.7e+42) {
		tmp = t_1 / t_2;
	} else if (u <= 2.7e+16) {
		tmp = (v * (t1 / t_2)) / t1;
	} else {
		tmp = t_1 * (-1.0 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t1 * (v / u)
    t_2 = -u - t1
    if (u <= (-1.7d+42)) then
        tmp = t_1 / t_2
    else if (u <= 2.7d+16) then
        tmp = (v * (t1 / t_2)) / t1
    else
        tmp = t_1 * ((-1.0d0) / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = t1 * (v / u);
	double t_2 = -u - t1;
	double tmp;
	if (u <= -1.7e+42) {
		tmp = t_1 / t_2;
	} else if (u <= 2.7e+16) {
		tmp = (v * (t1 / t_2)) / t1;
	} else {
		tmp = t_1 * (-1.0 / u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = t1 * (v / u)
	t_2 = -u - t1
	tmp = 0
	if u <= -1.7e+42:
		tmp = t_1 / t_2
	elif u <= 2.7e+16:
		tmp = (v * (t1 / t_2)) / t1
	else:
		tmp = t_1 * (-1.0 / u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(t1 * Float64(v / u))
	t_2 = Float64(Float64(-u) - t1)
	tmp = 0.0
	if (u <= -1.7e+42)
		tmp = Float64(t_1 / t_2);
	elseif (u <= 2.7e+16)
		tmp = Float64(Float64(v * Float64(t1 / t_2)) / t1);
	else
		tmp = Float64(t_1 * Float64(-1.0 / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = t1 * (v / u);
	t_2 = -u - t1;
	tmp = 0.0;
	if (u <= -1.7e+42)
		tmp = t_1 / t_2;
	elseif (u <= 2.7e+16)
		tmp = (v * (t1 / t_2)) / t1;
	else
		tmp = t_1 * (-1.0 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-u) - t1), $MachinePrecision]}, If[LessEqual[u, -1.7e+42], N[(t$95$1 / t$95$2), $MachinePrecision], If[LessEqual[u, 2.7e+16], N[(N[(v * N[(t1 / t$95$2), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision], N[(t$95$1 * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;u \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{t\_2}}{t1}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{-1}{u}\\


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

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr99.8%

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

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

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

        \[\leadsto \frac{-\color{blue}{t1 \cdot \frac{v}{u}}}{t1 + u} \]
      3. distribute-rgt-neg-in90.9%

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

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

        \[\leadsto \frac{t1 \cdot \color{blue}{\frac{-1 \cdot v}{u}}}{t1 + u} \]
      6. mul-1-neg90.9%

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

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

    if -1.69999999999999988e42 < u < 2.7e16

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.7e16 < u

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1 \cdot \frac{v}{u}}}{u} \]
      10. neg-mul-184.7%

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

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

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

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

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

Alternative 5: 77.3% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -4.99999999999999999e-79

    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. associate-/l*72.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{u}}{-1}}{u}} \]
    9. Taylor expanded in t1 around 0 71.3%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\frac{t1}{\frac{u}{v}}}}{-1}}{u} \]
    11. Simplified78.0%

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

    if -4.99999999999999999e-79 < u < 8.8e14

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

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

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

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

    if 8.8e14 < u

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1 \cdot \frac{v}{u}}}{u} \]
      10. neg-mul-184.7%

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

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

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

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

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

Alternative 6: 78.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t1 \cdot \frac{v}{u}\\ \mathbf{if}\;u \leq -4.1 \cdot 10^{-55}:\\ \;\;\;\;\frac{t\_1}{-u}\\ \mathbf{elif}\;u \leq 9.4 \cdot 10^{+14}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \frac{-1}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* t1 (/ v u))))
   (if (<= u -4.1e-55)
     (/ t_1 (- u))
     (if (<= u 9.4e+14) (/ v (- t1)) (* t_1 (/ -1.0 u))))))
double code(double u, double v, double t1) {
	double t_1 = t1 * (v / u);
	double tmp;
	if (u <= -4.1e-55) {
		tmp = t_1 / -u;
	} else if (u <= 9.4e+14) {
		tmp = v / -t1;
	} else {
		tmp = t_1 * (-1.0 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t1 * (v / u)
    if (u <= (-4.1d-55)) then
        tmp = t_1 / -u
    else if (u <= 9.4d+14) then
        tmp = v / -t1
    else
        tmp = t_1 * ((-1.0d0) / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = t1 * (v / u);
	double tmp;
	if (u <= -4.1e-55) {
		tmp = t_1 / -u;
	} else if (u <= 9.4e+14) {
		tmp = v / -t1;
	} else {
		tmp = t_1 * (-1.0 / u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = t1 * (v / u)
	tmp = 0
	if u <= -4.1e-55:
		tmp = t_1 / -u
	elif u <= 9.4e+14:
		tmp = v / -t1
	else:
		tmp = t_1 * (-1.0 / u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(t1 * Float64(v / u))
	tmp = 0.0
	if (u <= -4.1e-55)
		tmp = Float64(t_1 / Float64(-u));
	elseif (u <= 9.4e+14)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(t_1 * Float64(-1.0 / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = t1 * (v / u);
	tmp = 0.0;
	if (u <= -4.1e-55)
		tmp = t_1 / -u;
	elseif (u <= 9.4e+14)
		tmp = v / -t1;
	else
		tmp = t_1 * (-1.0 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -4.1e-55], N[(t$95$1 / (-u)), $MachinePrecision], If[LessEqual[u, 9.4e+14], N[(v / (-t1)), $MachinePrecision], N[(t$95$1 * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t1 \cdot \frac{v}{u}\\
\mathbf{if}\;u \leq -4.1 \cdot 10^{-55}:\\
\;\;\;\;\frac{t\_1}{-u}\\

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{-1}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -4.0999999999999998e-55

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{-t1 \cdot \frac{v}{u}}{\color{blue}{1}}}{u} \]
      3. /-rgt-identity78.8%

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

        \[\leadsto \frac{-\color{blue}{\frac{v}{u} \cdot t1}}{u} \]
      5. distribute-rgt-neg-in78.8%

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

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

    if -4.0999999999999998e-55 < u < 9.4e14

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

    if 9.4e14 < u

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1 \cdot \frac{v}{u}}}{u} \]
      10. neg-mul-184.7%

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

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

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

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

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

Alternative 7: 78.0% accurate, 0.7× speedup?

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

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{-t1 \cdot \frac{v}{u}}{\color{blue}{1}}}{u} \]
      3. /-rgt-identity81.8%

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

        \[\leadsto \frac{-\color{blue}{\frac{v}{u} \cdot t1}}{u} \]
      5. distribute-rgt-neg-in81.8%

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

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

    if -4.3999999999999999e-55 < u < 8.8e14

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.30000000000000011e-55 or 2.2e15 < u

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

    if -2.30000000000000011e-55 < u < 2.2e15

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 68.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -4.9999999999999996e44 or 3.9e16 < u

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\frac{\color{blue}{u}}{\frac{v}{u}}} \]
    8. Applied egg-rr60.5%

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

    if -4.9999999999999996e44 < u < 3.9e16

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 67.0% accurate, 0.7× speedup?

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

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.20000000000000012e43 < u < 2.6e16

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 97.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-u\right) - t1\\ \mathbf{if}\;v \leq 3.4 \cdot 10^{+205}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t\_1}}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (- (- u) t1)))
   (if (<= v 3.4e+205)
     (* (/ v (+ t1 u)) (/ t1 t_1))
     (* t1 (/ (/ v t_1) (+ t1 u))))))
double code(double u, double v, double t1) {
	double t_1 = -u - t1;
	double tmp;
	if (v <= 3.4e+205) {
		tmp = (v / (t1 + u)) * (t1 / t_1);
	} else {
		tmp = t1 * ((v / t_1) / (t1 + u));
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -u - t1
    if (v <= 3.4d+205) then
        tmp = (v / (t1 + u)) * (t1 / t_1)
    else
        tmp = t1 * ((v / t_1) / (t1 + u))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -u - t1;
	double tmp;
	if (v <= 3.4e+205) {
		tmp = (v / (t1 + u)) * (t1 / t_1);
	} else {
		tmp = t1 * ((v / t_1) / (t1 + u));
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -u - t1
	tmp = 0
	if v <= 3.4e+205:
		tmp = (v / (t1 + u)) * (t1 / t_1)
	else:
		tmp = t1 * ((v / t_1) / (t1 + u))
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-u) - t1)
	tmp = 0.0
	if (v <= 3.4e+205)
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / t_1));
	else
		tmp = Float64(t1 * Float64(Float64(v / t_1) / Float64(t1 + u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -u - t1;
	tmp = 0.0;
	if (v <= 3.4e+205)
		tmp = (v / (t1 + u)) * (t1 / t_1);
	else
		tmp = t1 * ((v / t_1) / (t1 + u));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-u) - t1), $MachinePrecision]}, If[LessEqual[v, 3.4e+205], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / t$95$1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / t$95$1), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

    if 3.4e205 < v

    1. Initial program 51.7%

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

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

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

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

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

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

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

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

Alternative 12: 58.7% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 76.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified25.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{v}{u}} \]
      8. clear-num27.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \]
      9. inv-pow27.9%

        \[\leadsto \color{blue}{{\left(\frac{u}{v}\right)}^{-1}} \]
    10. Applied egg-rr27.9%

      \[\leadsto \color{blue}{{\left(\frac{u}{v}\right)}^{-1}} \]
    11. Step-by-step derivation
      1. unpow-127.9%

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

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

    if -9.5000000000000008e112 < u < 1.59999999999999994e136

    1. Initial program 68.0%

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

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999994e136 < u

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{v}{u}} \cdot \sqrt{\frac{v}{u}}} \]
      7. add-sqr-sqrt41.8%

        \[\leadsto \color{blue}{\frac{v}{u}} \]
      8. div-inv41.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -9.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{1}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.6 \cdot 10^{+136}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 21.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.15 \cdot 10^{+232} \lor \neg \left(t1 \leq 2.8 \cdot 10^{+185}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.1500000000000001e232 or 2.79999999999999982e185 < t1

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity91.5%

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

        \[\leadsto \color{blue}{\frac{-v}{t1} \cdot 1} \]
      3. add-sqr-sqrt50.2%

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{t1} \cdot 1 \]
      6. sqrt-unprod13.6%

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

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

      \[\leadsto \color{blue}{\frac{v}{t1} \cdot 1} \]
    10. Step-by-step derivation
      1. *-rgt-identity45.4%

        \[\leadsto \color{blue}{\frac{v}{t1}} \]
    11. Simplified45.4%

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

    if -2.1500000000000001e232 < t1 < 2.79999999999999982e185

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified16.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{v}{u}} \]
      8. div-inv14.5%

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

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

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

        \[\leadsto \frac{\color{blue}{v}}{u} \]
    12. Simplified14.5%

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

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

Alternative 14: 98.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 56.0% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < 8.19999999999999961e138

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

    if 8.19999999999999961e138 < u

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{v}{u}} \cdot \sqrt{\frac{v}{u}}} \]
      7. add-sqr-sqrt41.8%

        \[\leadsto \color{blue}{\frac{v}{u}} \]
      8. div-inv41.8%

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

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

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

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

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

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

Alternative 16: 61.9% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{v}{\left(-u\right) - 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(v / Float64(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}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 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 70.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  8. Step-by-step derivation
    1. *-un-lft-identity52.7%

      \[\leadsto \color{blue}{1 \cdot \frac{-v}{t1}} \]
    2. *-commutative52.7%

      \[\leadsto \color{blue}{\frac{-v}{t1} \cdot 1} \]
    3. add-sqr-sqrt24.1%

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1} \cdot 1 \]
    7. add-sqr-sqrt10.3%

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

    \[\leadsto \color{blue}{\frac{v}{t1} \cdot 1} \]
  10. Step-by-step derivation
    1. *-rgt-identity10.3%

      \[\leadsto \color{blue}{\frac{v}{t1}} \]
  11. Simplified10.3%

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

Reproduce

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