Rosa's DopplerBench

Percentage Accurate: 72.4% → 98.1%
Time: 51.5s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 72.4% 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, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t1 \leq 1.6 \cdot 10^{+160}:\\
\;\;\;\;t1 \cdot \frac{t\_2}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{t\_1}\\


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

    1. Initial program 51.3%

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

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

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

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

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

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

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

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

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

    if -2.29999999999999997e113 < t1 < 1.5999999999999999e160

    1. Initial program 80.5%

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

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

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

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

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

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

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

    if 1.5999999999999999e160 < t1

    1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 77.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000014e-5 < u < 2.2499999999999999e-24

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

    if 2.2499999999999999e-24 < u

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 77.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999977e-7 < u < 2.3000000000000001e-24

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

    if 2.3000000000000001e-24 < u

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -t1 \cdot \color{blue}{\frac{1}{\frac{-u}{\frac{v}{t1 + u}}}} \]
      10. un-div-inv53.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{-\frac{u}{v}}} \]
      2. div-inv74.8%

        \[\leadsto \color{blue}{\frac{t1}{t1 + u} \cdot \frac{1}{-\frac{u}{v}}} \]
      3. distribute-neg-frac274.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 77.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.8500000000000002e-5 < u < 1.55e-24

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

    if 1.55e-24 < u

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -t1 \cdot \color{blue}{\frac{1}{\frac{-u}{\frac{v}{t1 + u}}}} \]
      10. un-div-inv53.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{-\frac{u}{v}}} \]
      2. div-inv74.8%

        \[\leadsto \color{blue}{\frac{t1}{t1 + u} \cdot \frac{1}{-\frac{u}{v}}} \]
      3. distribute-neg-frac274.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -0.00047 \lor \neg \left(u \leq 10^{-24}\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 -0.00047) (not (<= u 1e-24)))
   (* t1 (/ (/ v (- u)) u))
   (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -0.00047) || !(u <= 1e-24)) {
		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 <= (-0.00047d0)) .or. (.not. (u <= 1d-24))) 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 <= -0.00047) || !(u <= 1e-24)) {
		tmp = t1 * ((v / -u) / u);
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -0.00047) or not (u <= 1e-24):
		tmp = t1 * ((v / -u) / u)
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -0.00047) || !(u <= 1e-24))
		tmp = Float64(t1 * Float64(Float64(v / Float64(-u)) / u));
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -0.00047) || ~((u <= 1e-24)))
		tmp = t1 * ((v / -u) / u);
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -0.00047], N[Not[LessEqual[u, 1e-24]], $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 -0.00047 \lor \neg \left(u \leq 10^{-24}\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 < -4.69999999999999986e-4 or 9.99999999999999924e-25 < u

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

    if -4.69999999999999986e-4 < u < 9.99999999999999924e-25

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 68.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.0500000000000001e53 or 2.1000000000000002e103 < u

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -t1 \cdot \color{blue}{\frac{1}{\frac{-u}{\frac{v}{t1 + u}}}} \]
      10. un-div-inv71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{-u \cdot \frac{u}{v}}} \]
      2. distribute-lft-neg-in85.9%

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

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

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

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

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

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

        \[\leadsto \frac{t1}{u \cdot \color{blue}{\frac{1}{\frac{v}{u}}}} \]
      9. un-div-inv71.4%

        \[\leadsto \frac{t1}{\color{blue}{\frac{u}{\frac{v}{u}}}} \]
    14. Applied egg-rr71.4%

      \[\leadsto \frac{t1}{\color{blue}{\frac{u}{\frac{v}{u}}}} \]
    15. Step-by-step derivation
      1. associate-/r/71.4%

        \[\leadsto \frac{t1}{\color{blue}{\frac{u}{v} \cdot u}} \]
    16. Simplified71.4%

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

    if -1.0500000000000001e53 < u < 2.1000000000000002e103

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 67.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.3 \cdot 10^{+152} \lor \neg \left(u \leq 4.7 \cdot 10^{+104}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.29999999999999976e152 or 4.70000000000000017e104 < u

    1. Initial program 78.5%

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

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

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

        \[\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
    5. Taylor expanded in t1 around 0 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{u}}{-\frac{u}{v}}} \]
      2. distribute-neg-frac88.8%

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

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

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

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

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

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

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

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

    if -5.29999999999999976e152 < u < 4.70000000000000017e104

    1. Initial program 69.4%

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

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

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

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

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

        \[\leadsto t1 \cdot \color{blue}{\frac{\frac{v}{t1 + u}}{-\left(t1 + u\right)}} \]
    3. Simplified80.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/98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+152} \lor \neg \left(u \leq 1.55 \cdot 10^{+156}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.8e152 or 1.5500000000000001e156 < u

    1. Initial program 78.1%

      \[\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*95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e152 < u < 1.5500000000000001e156

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.0% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 80.9%

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

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

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

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

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

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

      \[\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}{-1 \cdot u}} \]
    6. Step-by-step derivation
      1. mul-1-neg90.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-v}{u}} \]
    11. Step-by-step derivation
      1. clear-num48.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-v}}} \]
      2. distribute-neg-frac248.5%

        \[\leadsto \frac{1}{\color{blue}{-\frac{u}{v}}} \]
      3. inv-pow48.5%

        \[\leadsto \color{blue}{{\left(-\frac{u}{v}\right)}^{-1}} \]
      4. add-sqr-sqrt19.3%

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

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

        \[\leadsto {\left(\sqrt{\color{blue}{\frac{u}{v} \cdot \frac{u}{v}}}\right)}^{-1} \]
      7. sqrt-unprod29.0%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{u}{v}} \cdot \sqrt{\frac{u}{v}}\right)}}^{-1} \]
      8. add-sqr-sqrt48.4%

        \[\leadsto {\color{blue}{\left(\frac{u}{v}\right)}}^{-1} \]
    12. Applied egg-rr48.4%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \]
    14. Simplified48.4%

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

    if -1.3999999999999999e50 < u < 1.04999999999999991e156

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999991e156 < u

    1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.4 \cdot 10^{+50}:\\ \;\;\;\;\frac{1}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.05 \cdot 10^{+156}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 23.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.9 \cdot 10^{+99} \lor \neg \left(t1 \leq 7.5 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.9000000000000002e99 or 7.50000000000000027e72 < t1

    1. Initial program 54.5%

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

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

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

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

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

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

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

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

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

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

    if -2.9000000000000002e99 < t1 < 7.50000000000000027e72

    1. Initial program 82.0%

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

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

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

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

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

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

      \[\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/98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 98.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

    \[\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-neg284.6%

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

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

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

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

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

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

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

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

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

      \[\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-neg46.6%

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

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

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

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

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

      \[\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-sqrt98.6%

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

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

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

Alternative 13: 97.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 61.2% accurate, 2.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{v}{u - t1}} \]
  16. Add Preprocessing

Alternative 15: 14.0% 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 72.5%

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

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

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

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

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

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

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

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

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

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

Reproduce

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