HairBSDF, Mp, upper

Percentage Accurate: 98.6% → 98.9%
Time: 21.3s
Alternatives: 16
Speedup: 1.0×

Specification

?
\[\left(\left(\left(\left(\left(-1 \leq cosTheta\_i \land cosTheta\_i \leq 1\right) \land \left(-1 \leq cosTheta\_O \land cosTheta\_O \leq 1\right)\right) \land \left(-1 \leq sinTheta\_i \land sinTheta\_i \leq 1\right)\right) \land \left(-1 \leq sinTheta\_O \land sinTheta\_O \leq 1\right)\right) \land 0.1 < v\right) \land v \leq 1.5707964\]
\[\begin{array}{l} \\ \frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \end{array} \]
(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
 :precision binary32
 (/
  (* (exp (- (/ (* sinTheta_i sinTheta_O) v))) (/ (* cosTheta_i cosTheta_O) v))
  (* (* (sinh (/ 1.0 v)) 2.0) v)))
float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
	return (expf(-((sinTheta_i * sinTheta_O) / v)) * ((cosTheta_i * cosTheta_O) / v)) / ((sinhf((1.0f / v)) * 2.0f) * v);
}
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
    real(4), intent (in) :: costheta_i
    real(4), intent (in) :: costheta_o
    real(4), intent (in) :: sintheta_i
    real(4), intent (in) :: sintheta_o
    real(4), intent (in) :: v
    code = (exp(-((sintheta_i * sintheta_o) / v)) * ((costheta_i * costheta_o) / v)) / ((sinh((1.0e0 / v)) * 2.0e0) * v)
end function
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	return Float32(Float32(exp(Float32(-Float32(Float32(sinTheta_i * sinTheta_O) / v))) * Float32(Float32(cosTheta_i * cosTheta_O) / v)) / Float32(Float32(sinh(Float32(Float32(1.0) / v)) * Float32(2.0)) * v))
end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	tmp = (exp(-((sinTheta_i * sinTheta_O) / v)) * ((cosTheta_i * cosTheta_O) / v)) / ((sinh((single(1.0) / v)) * single(2.0)) * v);
end
\begin{array}{l}

\\
\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}
\end{array}

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 98.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \end{array} \]
(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
 :precision binary32
 (/
  (* (exp (- (/ (* sinTheta_i sinTheta_O) v))) (/ (* cosTheta_i cosTheta_O) v))
  (* (* (sinh (/ 1.0 v)) 2.0) v)))
float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
	return (expf(-((sinTheta_i * sinTheta_O) / v)) * ((cosTheta_i * cosTheta_O) / v)) / ((sinhf((1.0f / v)) * 2.0f) * v);
}
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
    real(4), intent (in) :: costheta_i
    real(4), intent (in) :: costheta_o
    real(4), intent (in) :: sintheta_i
    real(4), intent (in) :: sintheta_o
    real(4), intent (in) :: v
    code = (exp(-((sintheta_i * sintheta_o) / v)) * ((costheta_i * costheta_o) / v)) / ((sinh((1.0e0 / v)) * 2.0e0) * v)
end function
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	return Float32(Float32(exp(Float32(-Float32(Float32(sinTheta_i * sinTheta_O) / v))) * Float32(Float32(cosTheta_i * cosTheta_O) / v)) / Float32(Float32(sinh(Float32(Float32(1.0) / v)) * Float32(2.0)) * v))
end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	tmp = (exp(-((sinTheta_i * sinTheta_O) / v)) * ((cosTheta_i * cosTheta_O) / v)) / ((sinh((single(1.0) / v)) * single(2.0)) * v);
end
\begin{array}{l}

\\
\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}
\end{array}

Alternative 1: 98.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}{\frac{\sinh \left(\frac{1}{v}\right) \cdot 2}{\frac{1}{v}}} \end{array} \]
(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
 :precision binary32
 (/
  (* cosTheta_O (* cosTheta_i (/ (exp (/ (* sinTheta_i sinTheta_O) (- v))) v)))
  (/ (* (sinh (/ 1.0 v)) 2.0) (/ 1.0 v))))
float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
	return (cosTheta_O * (cosTheta_i * (expf(((sinTheta_i * sinTheta_O) / -v)) / v))) / ((sinhf((1.0f / v)) * 2.0f) / (1.0f / v));
}
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
    real(4), intent (in) :: costheta_i
    real(4), intent (in) :: costheta_o
    real(4), intent (in) :: sintheta_i
    real(4), intent (in) :: sintheta_o
    real(4), intent (in) :: v
    code = (costheta_o * (costheta_i * (exp(((sintheta_i * sintheta_o) / -v)) / v))) / ((sinh((1.0e0 / v)) * 2.0e0) / (1.0e0 / v))
end function
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	return Float32(Float32(cosTheta_O * Float32(cosTheta_i * Float32(exp(Float32(Float32(sinTheta_i * sinTheta_O) / Float32(-v))) / v))) / Float32(Float32(sinh(Float32(Float32(1.0) / v)) * Float32(2.0)) / Float32(Float32(1.0) / v)))
end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	tmp = (cosTheta_O * (cosTheta_i * (exp(((sinTheta_i * sinTheta_O) / -v)) / v))) / ((sinh((single(1.0) / v)) * single(2.0)) / (single(1.0) / v));
end
\begin{array}{l}

\\
\frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}{\frac{\sinh \left(\frac{1}{v}\right) \cdot 2}{\frac{1}{v}}}
\end{array}
Derivation
  1. Initial program 98.7%

    \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    2. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    3. lift-/.f32N/A

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    4. div-invN/A

      \[\leadsto \frac{\color{blue}{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \frac{1}{v}\right)} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    5. lift-/.f32N/A

      \[\leadsto \frac{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \color{blue}{\frac{1}{v}}\right) \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    6. associate-*l*N/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    7. lift-*.f32N/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    8. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    9. associate-*l*N/A

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    10. lower-*.f32N/A

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    11. lower-*.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    12. *-commutativeN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{1}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    13. lift-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{1}{v}}\right)\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    14. div-invN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    15. lower-/.f3299.0

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    16. lift-neg.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    17. lift-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\mathsf{neg}\left(\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}\right)}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    18. distribute-neg-frac2N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    19. lower-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    20. lower-neg.f3299.0

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\color{blue}{-v}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  4. Applied rewrites99.0%

    \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  5. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}{v}\right)}{\color{blue}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}} \]
    2. remove-double-divN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot \color{blue}{\frac{1}{\frac{1}{v}}}} \]
    3. lift-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot \frac{1}{\color{blue}{\frac{1}{v}}}} \]
    4. un-div-invN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}{v}\right)}{\color{blue}{\frac{\sinh \left(\frac{1}{v}\right) \cdot 2}{\frac{1}{v}}}} \]
    5. lower-/.f3299.1

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}{\color{blue}{\frac{\sinh \left(\frac{1}{v}\right) \cdot 2}{\frac{1}{v}}}} \]
  6. Applied rewrites99.1%

    \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}{\color{blue}{\frac{\sinh \left(\frac{1}{v}\right) \cdot 2}{\frac{1}{v}}}} \]
  7. Add Preprocessing

Alternative 2: 98.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \end{array} \]
(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
 :precision binary32
 (/
  (* cosTheta_O (* cosTheta_i (/ (exp (/ (* sinTheta_i sinTheta_O) (- v))) v)))
  (* v (* (sinh (/ 1.0 v)) 2.0))))
float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
	return (cosTheta_O * (cosTheta_i * (expf(((sinTheta_i * sinTheta_O) / -v)) / v))) / (v * (sinhf((1.0f / v)) * 2.0f));
}
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
    real(4), intent (in) :: costheta_i
    real(4), intent (in) :: costheta_o
    real(4), intent (in) :: sintheta_i
    real(4), intent (in) :: sintheta_o
    real(4), intent (in) :: v
    code = (costheta_o * (costheta_i * (exp(((sintheta_i * sintheta_o) / -v)) / v))) / (v * (sinh((1.0e0 / v)) * 2.0e0))
end function
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	return Float32(Float32(cosTheta_O * Float32(cosTheta_i * Float32(exp(Float32(Float32(sinTheta_i * sinTheta_O) / Float32(-v))) / v))) / Float32(v * Float32(sinh(Float32(Float32(1.0) / v)) * Float32(2.0))))
end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	tmp = (cosTheta_O * (cosTheta_i * (exp(((sinTheta_i * sinTheta_O) / -v)) / v))) / (v * (sinh((single(1.0) / v)) * single(2.0)));
end
\begin{array}{l}

\\
\frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)}
\end{array}
Derivation
  1. Initial program 98.7%

    \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    2. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    3. lift-/.f32N/A

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    4. div-invN/A

      \[\leadsto \frac{\color{blue}{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \frac{1}{v}\right)} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    5. lift-/.f32N/A

      \[\leadsto \frac{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \color{blue}{\frac{1}{v}}\right) \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    6. associate-*l*N/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    7. lift-*.f32N/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    8. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    9. associate-*l*N/A

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    10. lower-*.f32N/A

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    11. lower-*.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    12. *-commutativeN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{1}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    13. lift-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{1}{v}}\right)\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    14. div-invN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    15. lower-/.f3299.0

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    16. lift-neg.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    17. lift-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\mathsf{neg}\left(\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}\right)}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    18. distribute-neg-frac2N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    19. lower-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    20. lower-neg.f3299.0

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\color{blue}{-v}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  4. Applied rewrites99.0%

    \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  5. Final simplification99.0%

    \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \]
  6. Add Preprocessing

Alternative 3: 98.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{cosTheta\_O \cdot \frac{cosTheta\_i}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot \left(v \cdot 2\right)\right) \cdot e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}} \end{array} \]
(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
 :precision binary32
 (/
  (* cosTheta_O (/ cosTheta_i v))
  (* (* (sinh (/ 1.0 v)) (* v 2.0)) (exp (/ (* sinTheta_i sinTheta_O) v)))))
float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
	return (cosTheta_O * (cosTheta_i / v)) / ((sinhf((1.0f / v)) * (v * 2.0f)) * expf(((sinTheta_i * sinTheta_O) / v)));
}
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
    real(4), intent (in) :: costheta_i
    real(4), intent (in) :: costheta_o
    real(4), intent (in) :: sintheta_i
    real(4), intent (in) :: sintheta_o
    real(4), intent (in) :: v
    code = (costheta_o * (costheta_i / v)) / ((sinh((1.0e0 / v)) * (v * 2.0e0)) * exp(((sintheta_i * sintheta_o) / v)))
end function
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	return Float32(Float32(cosTheta_O * Float32(cosTheta_i / v)) / Float32(Float32(sinh(Float32(Float32(1.0) / v)) * Float32(v * Float32(2.0))) * exp(Float32(Float32(sinTheta_i * sinTheta_O) / v))))
end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	tmp = (cosTheta_O * (cosTheta_i / v)) / ((sinh((single(1.0) / v)) * (v * single(2.0))) * exp(((sinTheta_i * sinTheta_O) / v)));
end
\begin{array}{l}

\\
\frac{cosTheta\_O \cdot \frac{cosTheta\_i}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot \left(v \cdot 2\right)\right) \cdot e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}
\end{array}
Derivation
  1. Initial program 98.7%

    \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}} \]
    2. div-invN/A

      \[\leadsto \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}\right) \cdot \frac{1}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}} \]
    3. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{1}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}\right)} \]
    4. lift-*.f32N/A

      \[\leadsto \frac{1}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}\right)} \]
    5. *-commutativeN/A

      \[\leadsto \frac{1}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \cdot \color{blue}{\left(\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)} \]
    6. clear-numN/A

      \[\leadsto \color{blue}{\frac{1}{\frac{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}{1}}} \cdot \left(\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right) \]
    7. lift-exp.f32N/A

      \[\leadsto \frac{1}{\frac{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}{1}} \cdot \left(\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot \color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}\right) \]
    8. lift-neg.f32N/A

      \[\leadsto \frac{1}{\frac{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}{1}} \cdot \left(\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}\right) \]
    9. exp-negN/A

      \[\leadsto \frac{1}{\frac{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}{1}} \cdot \left(\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot \color{blue}{\frac{1}{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}}\right) \]
    10. un-div-invN/A

      \[\leadsto \frac{1}{\frac{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}{1}} \cdot \color{blue}{\frac{\frac{cosTheta\_i \cdot cosTheta\_O}{v}}{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}} \]
    11. frac-timesN/A

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\frac{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}{1} \cdot e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}} \]
  4. Applied rewrites98.8%

    \[\leadsto \color{blue}{\frac{cosTheta\_O \cdot \frac{cosTheta\_i}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot \left(v \cdot 2\right)\right) \cdot e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}} \]
  5. Add Preprocessing

Alternative 4: 98.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{1}{v}\right)}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \end{array} \]
(FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
 :precision binary32
 (/ (* cosTheta_O (* cosTheta_i (/ 1.0 v))) (* v (* (sinh (/ 1.0 v)) 2.0))))
float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
	return (cosTheta_O * (cosTheta_i * (1.0f / v))) / (v * (sinhf((1.0f / v)) * 2.0f));
}
real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
    real(4), intent (in) :: costheta_i
    real(4), intent (in) :: costheta_o
    real(4), intent (in) :: sintheta_i
    real(4), intent (in) :: sintheta_o
    real(4), intent (in) :: v
    code = (costheta_o * (costheta_i * (1.0e0 / v))) / (v * (sinh((1.0e0 / v)) * 2.0e0))
end function
function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	return Float32(Float32(cosTheta_O * Float32(cosTheta_i * Float32(Float32(1.0) / v))) / Float32(v * Float32(sinh(Float32(Float32(1.0) / v)) * Float32(2.0))))
end
function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
	tmp = (cosTheta_O * (cosTheta_i * (single(1.0) / v))) / (v * (sinh((single(1.0) / v)) * single(2.0)));
end
\begin{array}{l}

\\
\frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{1}{v}\right)}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)}
\end{array}
Derivation
  1. Initial program 98.7%

    \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    2. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    3. lift-/.f32N/A

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    4. div-invN/A

      \[\leadsto \frac{\color{blue}{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \frac{1}{v}\right)} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    5. lift-/.f32N/A

      \[\leadsto \frac{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \color{blue}{\frac{1}{v}}\right) \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    6. associate-*l*N/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    7. lift-*.f32N/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    8. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    9. associate-*l*N/A

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    10. lower-*.f32N/A

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    11. lower-*.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    12. *-commutativeN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{1}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    13. lift-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{1}{v}}\right)\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    14. div-invN/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    15. lower-/.f3299.0

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    16. lift-neg.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    17. lift-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\mathsf{neg}\left(\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}\right)}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    18. distribute-neg-frac2N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    19. lower-/.f32N/A

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    20. lower-neg.f3299.0

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\color{blue}{-v}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  4. Applied rewrites99.0%

    \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  5. Taylor expanded in sinTheta_i around 0

    \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{\color{blue}{1}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
  6. Step-by-step derivation
    1. Applied rewrites98.9%

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{\color{blue}{1}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    2. Final simplification98.9%

      \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{1}{v}\right)}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \]
    3. Add Preprocessing

    Alternative 5: 98.3% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \frac{cosTheta\_O \cdot \frac{cosTheta\_i}{v}}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \end{array} \]
    (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
     :precision binary32
     (/ (* cosTheta_O (/ cosTheta_i v)) (* v (* (sinh (/ 1.0 v)) 2.0))))
    float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
    	return (cosTheta_O * (cosTheta_i / v)) / (v * (sinhf((1.0f / v)) * 2.0f));
    }
    
    real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
        real(4), intent (in) :: costheta_i
        real(4), intent (in) :: costheta_o
        real(4), intent (in) :: sintheta_i
        real(4), intent (in) :: sintheta_o
        real(4), intent (in) :: v
        code = (costheta_o * (costheta_i / v)) / (v * (sinh((1.0e0 / v)) * 2.0e0))
    end function
    
    function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
    	return Float32(Float32(cosTheta_O * Float32(cosTheta_i / v)) / Float32(v * Float32(sinh(Float32(Float32(1.0) / v)) * Float32(2.0))))
    end
    
    function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
    	tmp = (cosTheta_O * (cosTheta_i / v)) / (v * (sinh((single(1.0) / v)) * single(2.0)));
    end
    
    \begin{array}{l}
    
    \\
    \frac{cosTheta\_O \cdot \frac{cosTheta\_i}{v}}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)}
    \end{array}
    
    Derivation
    1. Initial program 98.7%

      \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f32N/A

        \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      3. lift-/.f32N/A

        \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      4. div-invN/A

        \[\leadsto \frac{\color{blue}{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \frac{1}{v}\right)} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      5. lift-/.f32N/A

        \[\leadsto \frac{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \color{blue}{\frac{1}{v}}\right) \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      6. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      7. lift-*.f32N/A

        \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      9. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      10. lower-*.f32N/A

        \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      11. lower-*.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      12. *-commutativeN/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{1}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      13. lift-/.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{1}{v}}\right)\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      14. div-invN/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      15. lower-/.f3299.0

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      16. lift-neg.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      17. lift-/.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\mathsf{neg}\left(\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}\right)}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      18. distribute-neg-frac2N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      19. lower-/.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      20. lower-neg.f3299.0

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\color{blue}{-v}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    4. Applied rewrites99.0%

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    5. Taylor expanded in sinTheta_i around 0

      \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\frac{cosTheta\_i}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    6. Step-by-step derivation
      1. lower-/.f3298.6

        \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\frac{cosTheta\_i}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    7. Applied rewrites98.6%

      \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\frac{cosTheta\_i}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    8. Final simplification98.6%

      \[\leadsto \frac{cosTheta\_O \cdot \frac{cosTheta\_i}{v}}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \]
    9. Add Preprocessing

    Alternative 6: 98.3% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \frac{\frac{cosTheta\_O \cdot cosTheta\_i}{v}}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \end{array} \]
    (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
     :precision binary32
     (/ (/ (* cosTheta_O cosTheta_i) v) (* v (* (sinh (/ 1.0 v)) 2.0))))
    float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
    	return ((cosTheta_O * cosTheta_i) / v) / (v * (sinhf((1.0f / v)) * 2.0f));
    }
    
    real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
        real(4), intent (in) :: costheta_i
        real(4), intent (in) :: costheta_o
        real(4), intent (in) :: sintheta_i
        real(4), intent (in) :: sintheta_o
        real(4), intent (in) :: v
        code = ((costheta_o * costheta_i) / v) / (v * (sinh((1.0e0 / v)) * 2.0e0))
    end function
    
    function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
    	return Float32(Float32(Float32(cosTheta_O * cosTheta_i) / v) / Float32(v * Float32(sinh(Float32(Float32(1.0) / v)) * Float32(2.0))))
    end
    
    function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
    	tmp = ((cosTheta_O * cosTheta_i) / v) / (v * (sinh((single(1.0) / v)) * single(2.0)));
    end
    
    \begin{array}{l}
    
    \\
    \frac{\frac{cosTheta\_O \cdot cosTheta\_i}{v}}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)}
    \end{array}
    
    Derivation
    1. Initial program 98.7%

      \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    2. Add Preprocessing
    3. Taylor expanded in sinTheta_i around 0

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    4. Step-by-step derivation
      1. lower-/.f32N/A

        \[\leadsto \frac{\color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      2. lower-*.f3298.5

        \[\leadsto \frac{\frac{\color{blue}{cosTheta\_O \cdot cosTheta\_i}}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    5. Applied rewrites98.5%

      \[\leadsto \frac{\color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    6. Final simplification98.5%

      \[\leadsto \frac{\frac{cosTheta\_O \cdot cosTheta\_i}{v}}{v \cdot \left(\sinh \left(\frac{1}{v}\right) \cdot 2\right)} \]
    7. Add Preprocessing

    Alternative 7: 70.3% accurate, 3.0× speedup?

    \[\begin{array}{l} \\ \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{v \cdot v} - -2}{v}} \cdot \frac{0.5}{v} \end{array} \]
    (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
     :precision binary32
     (*
      (/
       (* 2.0 (* cosTheta_O cosTheta_i))
       (*
        v
        (/
         (-
          (/ (+ 0.3333333333333333 (/ 0.016666666666666666 (* v v))) (* v v))
          -2.0)
         v)))
      (/ 0.5 v)))
    float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
    	return ((2.0f * (cosTheta_O * cosTheta_i)) / (v * ((((0.3333333333333333f + (0.016666666666666666f / (v * v))) / (v * v)) - -2.0f) / v))) * (0.5f / v);
    }
    
    real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
        real(4), intent (in) :: costheta_i
        real(4), intent (in) :: costheta_o
        real(4), intent (in) :: sintheta_i
        real(4), intent (in) :: sintheta_o
        real(4), intent (in) :: v
        code = ((2.0e0 * (costheta_o * costheta_i)) / (v * ((((0.3333333333333333e0 + (0.016666666666666666e0 / (v * v))) / (v * v)) - (-2.0e0)) / v))) * (0.5e0 / v)
    end function
    
    function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
    	return Float32(Float32(Float32(Float32(2.0) * Float32(cosTheta_O * cosTheta_i)) / Float32(v * Float32(Float32(Float32(Float32(Float32(0.3333333333333333) + Float32(Float32(0.016666666666666666) / Float32(v * v))) / Float32(v * v)) - Float32(-2.0)) / v))) * Float32(Float32(0.5) / v))
    end
    
    function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
    	tmp = ((single(2.0) * (cosTheta_O * cosTheta_i)) / (v * ((((single(0.3333333333333333) + (single(0.016666666666666666) / (v * v))) / (v * v)) - single(-2.0)) / v))) * (single(0.5) / v);
    end
    
    \begin{array}{l}
    
    \\
    \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{v \cdot v} - -2}{v}} \cdot \frac{0.5}{v}
    \end{array}
    
    Derivation
    1. Initial program 98.7%

      \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f32N/A

        \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      3. lift-/.f32N/A

        \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      4. div-invN/A

        \[\leadsto \frac{\color{blue}{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \frac{1}{v}\right)} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      5. lift-/.f32N/A

        \[\leadsto \frac{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \color{blue}{\frac{1}{v}}\right) \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      6. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      7. lift-*.f32N/A

        \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      9. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      10. lower-*.f32N/A

        \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      11. lower-*.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      12. *-commutativeN/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{1}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      13. lift-/.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{1}{v}}\right)\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      14. div-invN/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      15. lower-/.f3299.0

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      16. lift-neg.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      17. lift-/.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\mathsf{neg}\left(\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}\right)}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      18. distribute-neg-frac2N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      19. lower-/.f32N/A

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      20. lower-neg.f3299.0

        \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\color{blue}{-v}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    4. Applied rewrites99.0%

      \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
    5. Applied rewrites98.2%

      \[\leadsto \color{blue}{\frac{\frac{cosTheta\_O \cdot cosTheta\_i}{\sinh \left(\frac{1}{v}\right) \cdot e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}}{v} \cdot \frac{0.5}{v}} \]
    6. Taylor expanded in sinTheta_i around 0

      \[\leadsto \color{blue}{\left(2 \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}\right)} \cdot \frac{\frac{1}{2}}{v} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
      2. lower-/.f32N/A

        \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
      3. lower-*.f32N/A

        \[\leadsto \frac{\color{blue}{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      4. lower-*.f32N/A

        \[\leadsto \frac{2 \cdot \color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)}}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      5. lower-*.f32N/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{\color{blue}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
      6. rec-expN/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \color{blue}{e^{\mathsf{neg}\left(\frac{1}{v}\right)}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      7. distribute-neg-fracN/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      8. metadata-evalN/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\frac{\color{blue}{-1}}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      9. lower--.f32N/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \color{blue}{\left(e^{\frac{1}{v}} - e^{\frac{-1}{v}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
      10. lower-exp.f32N/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(\color{blue}{e^{\frac{1}{v}}} - e^{\frac{-1}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      11. lower-/.f32N/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\color{blue}{\frac{1}{v}}} - e^{\frac{-1}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      12. lower-exp.f32N/A

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \color{blue}{e^{\frac{-1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
      13. lower-/.f3298.4

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\color{blue}{\frac{-1}{v}}}\right)} \cdot \frac{0.5}{v} \]
    8. Applied rewrites98.4%

      \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\frac{-1}{v}}\right)}} \cdot \frac{0.5}{v} \]
    9. Taylor expanded in v around -inf

      \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(-1 \cdot \color{blue}{\frac{-1 \cdot \frac{\frac{1}{3} + \frac{1}{60} \cdot \frac{1}{{v}^{2}}}{{v}^{2}} - 2}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
    10. Step-by-step derivation
      1. Applied rewrites71.0%

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{-v \cdot v} + -2}{\color{blue}{-v}}} \cdot \frac{0.5}{v} \]
      2. Final simplification71.0%

        \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{v \cdot v} - -2}{v}} \cdot \frac{0.5}{v} \]
      3. Add Preprocessing

      Alternative 8: 70.2% accurate, 3.0× speedup?

      \[\begin{array}{l} \\ \left(cosTheta\_O \cdot \frac{cosTheta\_i}{2 \cdot \frac{\frac{0.16666666666666666 + \frac{0.008333333333333333}{v \cdot v}}{v \cdot v} + 1}{v}}\right) \cdot \frac{1}{v \cdot v} \end{array} \]
      (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
       :precision binary32
       (*
        (*
         cosTheta_O
         (/
          cosTheta_i
          (*
           2.0
           (/
            (+
             (/ (+ 0.16666666666666666 (/ 0.008333333333333333 (* v v))) (* v v))
             1.0)
            v))))
        (/ 1.0 (* v v))))
      float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
      	return (cosTheta_O * (cosTheta_i / (2.0f * ((((0.16666666666666666f + (0.008333333333333333f / (v * v))) / (v * v)) + 1.0f) / v)))) * (1.0f / (v * v));
      }
      
      real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
          real(4), intent (in) :: costheta_i
          real(4), intent (in) :: costheta_o
          real(4), intent (in) :: sintheta_i
          real(4), intent (in) :: sintheta_o
          real(4), intent (in) :: v
          code = (costheta_o * (costheta_i / (2.0e0 * ((((0.16666666666666666e0 + (0.008333333333333333e0 / (v * v))) / (v * v)) + 1.0e0) / v)))) * (1.0e0 / (v * v))
      end function
      
      function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
      	return Float32(Float32(cosTheta_O * Float32(cosTheta_i / Float32(Float32(2.0) * Float32(Float32(Float32(Float32(Float32(0.16666666666666666) + Float32(Float32(0.008333333333333333) / Float32(v * v))) / Float32(v * v)) + Float32(1.0)) / v)))) * Float32(Float32(1.0) / Float32(v * v)))
      end
      
      function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
      	tmp = (cosTheta_O * (cosTheta_i / (single(2.0) * ((((single(0.16666666666666666) + (single(0.008333333333333333) / (v * v))) / (v * v)) + single(1.0)) / v)))) * (single(1.0) / (v * v));
      end
      
      \begin{array}{l}
      
      \\
      \left(cosTheta\_O \cdot \frac{cosTheta\_i}{2 \cdot \frac{\frac{0.16666666666666666 + \frac{0.008333333333333333}{v \cdot v}}{v \cdot v} + 1}{v}}\right) \cdot \frac{1}{v \cdot v}
      \end{array}
      
      Derivation
      1. Initial program 98.7%

        \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f32N/A

          \[\leadsto \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}} \]
        2. lift-*.f32N/A

          \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
        3. lift-/.f32N/A

          \[\leadsto \frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
        4. associate-*r/N/A

          \[\leadsto \frac{\color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
        5. div-invN/A

          \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)\right) \cdot \frac{1}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
        6. lift-/.f32N/A

          \[\leadsto \frac{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)\right) \cdot \color{blue}{\frac{1}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
        7. lift-*.f32N/A

          \[\leadsto \frac{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)\right) \cdot \frac{1}{v}}{\color{blue}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}} \]
        8. times-fracN/A

          \[\leadsto \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{\sinh \left(\frac{1}{v}\right) \cdot 2} \cdot \frac{\frac{1}{v}}{v}} \]
        9. lower-*.f32N/A

          \[\leadsto \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{\sinh \left(\frac{1}{v}\right) \cdot 2} \cdot \frac{\frac{1}{v}}{v}} \]
      4. Applied rewrites97.8%

        \[\leadsto \color{blue}{\frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{\sinh \left(\frac{1}{v}\right) \cdot 2} \cdot \frac{1}{v \cdot v}} \]
      5. Taylor expanded in sinTheta_i around 0

        \[\leadsto \color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}}} \cdot \frac{1}{v \cdot v} \]
      6. Step-by-step derivation
        1. lower-/.f32N/A

          \[\leadsto \color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}}} \cdot \frac{1}{v \cdot v} \]
        2. lower-*.f32N/A

          \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot cosTheta\_i}}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}} \cdot \frac{1}{v \cdot v} \]
        3. lower--.f32N/A

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{\color{blue}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}}} \cdot \frac{1}{v \cdot v} \]
        4. lower-exp.f32N/A

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{\color{blue}{e^{\frac{1}{v}}} - \frac{1}{e^{\frac{1}{v}}}} \cdot \frac{1}{v \cdot v} \]
        5. lower-/.f32N/A

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\color{blue}{\frac{1}{v}}} - \frac{1}{e^{\frac{1}{v}}}} \cdot \frac{1}{v \cdot v} \]
        6. rec-expN/A

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \color{blue}{e^{\mathsf{neg}\left(\frac{1}{v}\right)}}} \cdot \frac{1}{v \cdot v} \]
        7. distribute-neg-fracN/A

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{v}}}} \cdot \frac{1}{v \cdot v} \]
        8. metadata-evalN/A

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\frac{\color{blue}{-1}}{v}}} \cdot \frac{1}{v \cdot v} \]
        9. lower-exp.f32N/A

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \color{blue}{e^{\frac{-1}{v}}}} \cdot \frac{1}{v \cdot v} \]
        10. lower-/.f3297.5

          \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\color{blue}{\frac{-1}{v}}}} \cdot \frac{1}{v \cdot v} \]
      7. Applied rewrites97.5%

        \[\leadsto \color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\frac{-1}{v}}}} \cdot \frac{1}{v \cdot v} \]
      8. Step-by-step derivation
        1. Applied rewrites97.5%

          \[\leadsto \left(\frac{cosTheta\_i}{\sinh \left(\frac{1}{v}\right) \cdot 2} \cdot \color{blue}{cosTheta\_O}\right) \cdot \frac{1}{v \cdot v} \]
        2. Taylor expanded in v around -inf

          \[\leadsto \left(\frac{cosTheta\_i}{\left(-1 \cdot \frac{-1 \cdot \frac{\frac{1}{6} + \frac{1}{120} \cdot \frac{1}{{v}^{2}}}{{v}^{2}} - 1}{v}\right) \cdot 2} \cdot cosTheta\_O\right) \cdot \frac{1}{v \cdot v} \]
        3. Step-by-step derivation
          1. Applied rewrites70.9%

            \[\leadsto \left(\frac{cosTheta\_i}{\frac{\frac{0.16666666666666666 + \frac{0.008333333333333333}{v \cdot v}}{-v \cdot v} + -1}{-v} \cdot 2} \cdot cosTheta\_O\right) \cdot \frac{1}{v \cdot v} \]
          2. Final simplification70.9%

            \[\leadsto \left(cosTheta\_O \cdot \frac{cosTheta\_i}{2 \cdot \frac{\frac{0.16666666666666666 + \frac{0.008333333333333333}{v \cdot v}}{v \cdot v} + 1}{v}}\right) \cdot \frac{1}{v \cdot v} \]
          3. Add Preprocessing

          Alternative 9: 70.2% accurate, 3.1× speedup?

          \[\begin{array}{l} \\ \frac{1}{v \cdot v} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{\frac{\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{v \cdot v} - -2}{v}} \end{array} \]
          (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
           :precision binary32
           (*
            (/ 1.0 (* v v))
            (/
             (* cosTheta_O cosTheta_i)
             (/
              (-
               (/ (+ 0.3333333333333333 (/ 0.016666666666666666 (* v v))) (* v v))
               -2.0)
              v))))
          float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
          	return (1.0f / (v * v)) * ((cosTheta_O * cosTheta_i) / ((((0.3333333333333333f + (0.016666666666666666f / (v * v))) / (v * v)) - -2.0f) / v));
          }
          
          real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
              real(4), intent (in) :: costheta_i
              real(4), intent (in) :: costheta_o
              real(4), intent (in) :: sintheta_i
              real(4), intent (in) :: sintheta_o
              real(4), intent (in) :: v
              code = (1.0e0 / (v * v)) * ((costheta_o * costheta_i) / ((((0.3333333333333333e0 + (0.016666666666666666e0 / (v * v))) / (v * v)) - (-2.0e0)) / v))
          end function
          
          function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
          	return Float32(Float32(Float32(1.0) / Float32(v * v)) * Float32(Float32(cosTheta_O * cosTheta_i) / Float32(Float32(Float32(Float32(Float32(0.3333333333333333) + Float32(Float32(0.016666666666666666) / Float32(v * v))) / Float32(v * v)) - Float32(-2.0)) / v)))
          end
          
          function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
          	tmp = (single(1.0) / (v * v)) * ((cosTheta_O * cosTheta_i) / ((((single(0.3333333333333333) + (single(0.016666666666666666) / (v * v))) / (v * v)) - single(-2.0)) / v));
          end
          
          \begin{array}{l}
          
          \\
          \frac{1}{v \cdot v} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{\frac{\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{v \cdot v} - -2}{v}}
          \end{array}
          
          Derivation
          1. Initial program 98.7%

            \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f32N/A

              \[\leadsto \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}} \]
            2. lift-*.f32N/A

              \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            3. lift-/.f32N/A

              \[\leadsto \frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            4. associate-*r/N/A

              \[\leadsto \frac{\color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            5. div-invN/A

              \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)\right) \cdot \frac{1}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            6. lift-/.f32N/A

              \[\leadsto \frac{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)\right) \cdot \color{blue}{\frac{1}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            7. lift-*.f32N/A

              \[\leadsto \frac{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)\right) \cdot \frac{1}{v}}{\color{blue}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v}} \]
            8. times-fracN/A

              \[\leadsto \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{\sinh \left(\frac{1}{v}\right) \cdot 2} \cdot \frac{\frac{1}{v}}{v}} \]
            9. lower-*.f32N/A

              \[\leadsto \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{\sinh \left(\frac{1}{v}\right) \cdot 2} \cdot \frac{\frac{1}{v}}{v}} \]
          4. Applied rewrites97.8%

            \[\leadsto \color{blue}{\frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}} \cdot \left(cosTheta\_i \cdot cosTheta\_O\right)}{\sinh \left(\frac{1}{v}\right) \cdot 2} \cdot \frac{1}{v \cdot v}} \]
          5. Taylor expanded in sinTheta_i around 0

            \[\leadsto \color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}}} \cdot \frac{1}{v \cdot v} \]
          6. Step-by-step derivation
            1. lower-/.f32N/A

              \[\leadsto \color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}}} \cdot \frac{1}{v \cdot v} \]
            2. lower-*.f32N/A

              \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot cosTheta\_i}}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}} \cdot \frac{1}{v \cdot v} \]
            3. lower--.f32N/A

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{\color{blue}{e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}}} \cdot \frac{1}{v \cdot v} \]
            4. lower-exp.f32N/A

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{\color{blue}{e^{\frac{1}{v}}} - \frac{1}{e^{\frac{1}{v}}}} \cdot \frac{1}{v \cdot v} \]
            5. lower-/.f32N/A

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\color{blue}{\frac{1}{v}}} - \frac{1}{e^{\frac{1}{v}}}} \cdot \frac{1}{v \cdot v} \]
            6. rec-expN/A

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \color{blue}{e^{\mathsf{neg}\left(\frac{1}{v}\right)}}} \cdot \frac{1}{v \cdot v} \]
            7. distribute-neg-fracN/A

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{v}}}} \cdot \frac{1}{v \cdot v} \]
            8. metadata-evalN/A

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\frac{\color{blue}{-1}}{v}}} \cdot \frac{1}{v \cdot v} \]
            9. lower-exp.f32N/A

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - \color{blue}{e^{\frac{-1}{v}}}} \cdot \frac{1}{v \cdot v} \]
            10. lower-/.f3297.5

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\color{blue}{\frac{-1}{v}}}} \cdot \frac{1}{v \cdot v} \]
          7. Applied rewrites97.5%

            \[\leadsto \color{blue}{\frac{cosTheta\_O \cdot cosTheta\_i}{e^{\frac{1}{v}} - e^{\frac{-1}{v}}}} \cdot \frac{1}{v \cdot v} \]
          8. Taylor expanded in v around -inf

            \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{-1 \cdot \color{blue}{\frac{-1 \cdot \frac{\frac{1}{3} + \frac{1}{60} \cdot \frac{1}{{v}^{2}}}{{v}^{2}} - 2}{v}}} \cdot \frac{1}{v \cdot v} \]
          9. Step-by-step derivation
            1. Applied rewrites70.9%

              \[\leadsto \frac{cosTheta\_O \cdot cosTheta\_i}{\frac{\left(-\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{v \cdot v}\right) + -2}{\color{blue}{-v}}} \cdot \frac{1}{v \cdot v} \]
            2. Final simplification70.9%

              \[\leadsto \frac{1}{v \cdot v} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{\frac{\frac{0.3333333333333333 + \frac{0.016666666666666666}{v \cdot v}}{v \cdot v} - -2}{v}} \]
            3. Add Preprocessing

            Alternative 10: 64.2% accurate, 3.7× speedup?

            \[\begin{array}{l} \\ \frac{0.5}{v} \cdot \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{2 + \frac{0.3333333333333333}{v \cdot v}}{v}} \end{array} \]
            (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
             :precision binary32
             (*
              (/ 0.5 v)
              (/
               (* 2.0 (* cosTheta_O cosTheta_i))
               (* v (/ (+ 2.0 (/ 0.3333333333333333 (* v v))) v)))))
            float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
            	return (0.5f / v) * ((2.0f * (cosTheta_O * cosTheta_i)) / (v * ((2.0f + (0.3333333333333333f / (v * v))) / v)));
            }
            
            real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
                real(4), intent (in) :: costheta_i
                real(4), intent (in) :: costheta_o
                real(4), intent (in) :: sintheta_i
                real(4), intent (in) :: sintheta_o
                real(4), intent (in) :: v
                code = (0.5e0 / v) * ((2.0e0 * (costheta_o * costheta_i)) / (v * ((2.0e0 + (0.3333333333333333e0 / (v * v))) / v)))
            end function
            
            function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
            	return Float32(Float32(Float32(0.5) / v) * Float32(Float32(Float32(2.0) * Float32(cosTheta_O * cosTheta_i)) / Float32(v * Float32(Float32(Float32(2.0) + Float32(Float32(0.3333333333333333) / Float32(v * v))) / v))))
            end
            
            function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
            	tmp = (single(0.5) / v) * ((single(2.0) * (cosTheta_O * cosTheta_i)) / (v * ((single(2.0) + (single(0.3333333333333333) / (v * v))) / v)));
            end
            
            \begin{array}{l}
            
            \\
            \frac{0.5}{v} \cdot \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{2 + \frac{0.3333333333333333}{v \cdot v}}{v}}
            \end{array}
            
            Derivation
            1. Initial program 98.7%

              \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f32N/A

                \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              2. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              3. lift-/.f32N/A

                \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              4. div-invN/A

                \[\leadsto \frac{\color{blue}{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \frac{1}{v}\right)} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              5. lift-/.f32N/A

                \[\leadsto \frac{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \color{blue}{\frac{1}{v}}\right) \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              6. associate-*l*N/A

                \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              7. lift-*.f32N/A

                \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              8. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              9. associate-*l*N/A

                \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              10. lower-*.f32N/A

                \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              11. lower-*.f32N/A

                \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              12. *-commutativeN/A

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{1}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              13. lift-/.f32N/A

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{1}{v}}\right)\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              14. div-invN/A

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              15. lower-/.f3299.0

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              16. lift-neg.f32N/A

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              17. lift-/.f32N/A

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\mathsf{neg}\left(\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}\right)}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              18. distribute-neg-frac2N/A

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              19. lower-/.f32N/A

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              20. lower-neg.f3299.0

                \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\color{blue}{-v}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            4. Applied rewrites99.0%

              \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
            5. Applied rewrites98.2%

              \[\leadsto \color{blue}{\frac{\frac{cosTheta\_O \cdot cosTheta\_i}{\sinh \left(\frac{1}{v}\right) \cdot e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}}{v} \cdot \frac{0.5}{v}} \]
            6. Taylor expanded in sinTheta_i around 0

              \[\leadsto \color{blue}{\left(2 \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}\right)} \cdot \frac{\frac{1}{2}}{v} \]
            7. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
              2. lower-/.f32N/A

                \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
              3. lower-*.f32N/A

                \[\leadsto \frac{\color{blue}{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              4. lower-*.f32N/A

                \[\leadsto \frac{2 \cdot \color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)}}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              5. lower-*.f32N/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{\color{blue}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
              6. rec-expN/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \color{blue}{e^{\mathsf{neg}\left(\frac{1}{v}\right)}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              7. distribute-neg-fracN/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              8. metadata-evalN/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\frac{\color{blue}{-1}}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              9. lower--.f32N/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \color{blue}{\left(e^{\frac{1}{v}} - e^{\frac{-1}{v}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
              10. lower-exp.f32N/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(\color{blue}{e^{\frac{1}{v}}} - e^{\frac{-1}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              11. lower-/.f32N/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\color{blue}{\frac{1}{v}}} - e^{\frac{-1}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              12. lower-exp.f32N/A

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \color{blue}{e^{\frac{-1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              13. lower-/.f3298.4

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\color{blue}{\frac{-1}{v}}}\right)} \cdot \frac{0.5}{v} \]
            8. Applied rewrites98.4%

              \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\frac{-1}{v}}\right)}} \cdot \frac{0.5}{v} \]
            9. Taylor expanded in v around inf

              \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{2 + \frac{1}{3} \cdot \frac{1}{{v}^{2}}}{\color{blue}{v}}} \cdot \frac{\frac{1}{2}}{v} \]
            10. Step-by-step derivation
              1. Applied rewrites64.5%

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{2 + \frac{0.3333333333333333}{v \cdot v}}{\color{blue}{v}}} \cdot \frac{0.5}{v} \]
              2. Final simplification64.5%

                \[\leadsto \frac{0.5}{v} \cdot \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \frac{2 + \frac{0.3333333333333333}{v \cdot v}}{v}} \]
              3. Add Preprocessing

              Alternative 11: 64.2% accurate, 4.8× speedup?

              \[\begin{array}{l} \\ \frac{0.5}{v} \cdot \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{2 + \frac{0.3333333333333333}{v \cdot v}} \end{array} \]
              (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
               :precision binary32
               (*
                (/ 0.5 v)
                (/
                 (* 2.0 (* cosTheta_O cosTheta_i))
                 (+ 2.0 (/ 0.3333333333333333 (* v v))))))
              float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
              	return (0.5f / v) * ((2.0f * (cosTheta_O * cosTheta_i)) / (2.0f + (0.3333333333333333f / (v * v))));
              }
              
              real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
                  real(4), intent (in) :: costheta_i
                  real(4), intent (in) :: costheta_o
                  real(4), intent (in) :: sintheta_i
                  real(4), intent (in) :: sintheta_o
                  real(4), intent (in) :: v
                  code = (0.5e0 / v) * ((2.0e0 * (costheta_o * costheta_i)) / (2.0e0 + (0.3333333333333333e0 / (v * v))))
              end function
              
              function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
              	return Float32(Float32(Float32(0.5) / v) * Float32(Float32(Float32(2.0) * Float32(cosTheta_O * cosTheta_i)) / Float32(Float32(2.0) + Float32(Float32(0.3333333333333333) / Float32(v * v)))))
              end
              
              function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
              	tmp = (single(0.5) / v) * ((single(2.0) * (cosTheta_O * cosTheta_i)) / (single(2.0) + (single(0.3333333333333333) / (v * v))));
              end
              
              \begin{array}{l}
              
              \\
              \frac{0.5}{v} \cdot \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{2 + \frac{0.3333333333333333}{v \cdot v}}
              \end{array}
              
              Derivation
              1. Initial program 98.7%

                \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-*.f32N/A

                  \[\leadsto \frac{\color{blue}{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                2. *-commutativeN/A

                  \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                3. lift-/.f32N/A

                  \[\leadsto \frac{\color{blue}{\frac{cosTheta\_i \cdot cosTheta\_O}{v}} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                4. div-invN/A

                  \[\leadsto \frac{\color{blue}{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \frac{1}{v}\right)} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                5. lift-/.f32N/A

                  \[\leadsto \frac{\left(\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \color{blue}{\frac{1}{v}}\right) \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                6. associate-*l*N/A

                  \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right) \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                7. lift-*.f32N/A

                  \[\leadsto \frac{\color{blue}{\left(cosTheta\_i \cdot cosTheta\_O\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                8. *-commutativeN/A

                  \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                9. associate-*l*N/A

                  \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                10. lower-*.f32N/A

                  \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                11. lower-*.f32N/A

                  \[\leadsto \frac{cosTheta\_O \cdot \color{blue}{\left(cosTheta\_i \cdot \left(\frac{1}{v} \cdot e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}\right)\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                12. *-commutativeN/A

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \frac{1}{v}\right)}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                13. lift-/.f32N/A

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \left(e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)} \cdot \color{blue}{\frac{1}{v}}\right)\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                14. div-invN/A

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                15. lower-/.f3299.0

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \color{blue}{\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}{v}}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                16. lift-neg.f32N/A

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\mathsf{neg}\left(\frac{sinTheta\_i \cdot sinTheta\_O}{v}\right)}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                17. lift-/.f32N/A

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\mathsf{neg}\left(\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}\right)}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                18. distribute-neg-frac2N/A

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                19. lower-/.f32N/A

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\color{blue}{\frac{sinTheta\_i \cdot sinTheta\_O}{\mathsf{neg}\left(v\right)}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                20. lower-neg.f3299.0

                  \[\leadsto \frac{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{\color{blue}{-v}}}}{v}\right)}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              4. Applied rewrites99.0%

                \[\leadsto \frac{\color{blue}{cosTheta\_O \cdot \left(cosTheta\_i \cdot \frac{e^{\frac{sinTheta\_i \cdot sinTheta\_O}{-v}}}{v}\right)}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
              5. Applied rewrites98.2%

                \[\leadsto \color{blue}{\frac{\frac{cosTheta\_O \cdot cosTheta\_i}{\sinh \left(\frac{1}{v}\right) \cdot e^{\frac{sinTheta\_i \cdot sinTheta\_O}{v}}}}{v} \cdot \frac{0.5}{v}} \]
              6. Taylor expanded in sinTheta_i around 0

                \[\leadsto \color{blue}{\left(2 \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}\right)} \cdot \frac{\frac{1}{2}}{v} \]
              7. Step-by-step derivation
                1. associate-*r/N/A

                  \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
                2. lower-/.f32N/A

                  \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
                3. lower-*.f32N/A

                  \[\leadsto \frac{\color{blue}{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                4. lower-*.f32N/A

                  \[\leadsto \frac{2 \cdot \color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)}}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                5. lower-*.f32N/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{\color{blue}{v \cdot \left(e^{\frac{1}{v}} - \frac{1}{e^{\frac{1}{v}}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
                6. rec-expN/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \color{blue}{e^{\mathsf{neg}\left(\frac{1}{v}\right)}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                7. distribute-neg-fracN/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                8. metadata-evalN/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\frac{\color{blue}{-1}}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                9. lower--.f32N/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \color{blue}{\left(e^{\frac{1}{v}} - e^{\frac{-1}{v}}\right)}} \cdot \frac{\frac{1}{2}}{v} \]
                10. lower-exp.f32N/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(\color{blue}{e^{\frac{1}{v}}} - e^{\frac{-1}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                11. lower-/.f32N/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\color{blue}{\frac{1}{v}}} - e^{\frac{-1}{v}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                12. lower-exp.f32N/A

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - \color{blue}{e^{\frac{-1}{v}}}\right)} \cdot \frac{\frac{1}{2}}{v} \]
                13. lower-/.f3298.4

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\color{blue}{\frac{-1}{v}}}\right)} \cdot \frac{0.5}{v} \]
              8. Applied rewrites98.4%

                \[\leadsto \color{blue}{\frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v \cdot \left(e^{\frac{1}{v}} - e^{\frac{-1}{v}}\right)}} \cdot \frac{0.5}{v} \]
              9. Taylor expanded in v around inf

                \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{2 + \color{blue}{\frac{1}{3} \cdot \frac{1}{{v}^{2}}}} \cdot \frac{\frac{1}{2}}{v} \]
              10. Step-by-step derivation
                1. Applied rewrites64.5%

                  \[\leadsto \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{2 + \color{blue}{\frac{0.3333333333333333}{v \cdot v}}} \cdot \frac{0.5}{v} \]
                2. Final simplification64.5%

                  \[\leadsto \frac{0.5}{v} \cdot \frac{2 \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{2 + \frac{0.3333333333333333}{v \cdot v}} \]
                3. Add Preprocessing

                Alternative 12: 59.2% accurate, 7.0× speedup?

                \[\begin{array}{l} \\ \frac{\frac{1}{v}}{\frac{2}{cosTheta\_O \cdot cosTheta\_i}} \end{array} \]
                (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
                 :precision binary32
                 (/ (/ 1.0 v) (/ 2.0 (* cosTheta_O cosTheta_i))))
                float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
                	return (1.0f / v) / (2.0f / (cosTheta_O * cosTheta_i));
                }
                
                real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
                    real(4), intent (in) :: costheta_i
                    real(4), intent (in) :: costheta_o
                    real(4), intent (in) :: sintheta_i
                    real(4), intent (in) :: sintheta_o
                    real(4), intent (in) :: v
                    code = (1.0e0 / v) / (2.0e0 / (costheta_o * costheta_i))
                end function
                
                function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                	return Float32(Float32(Float32(1.0) / v) / Float32(Float32(2.0) / Float32(cosTheta_O * cosTheta_i)))
                end
                
                function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                	tmp = (single(1.0) / v) / (single(2.0) / (cosTheta_O * cosTheta_i));
                end
                
                \begin{array}{l}
                
                \\
                \frac{\frac{1}{v}}{\frac{2}{cosTheta\_O \cdot cosTheta\_i}}
                \end{array}
                
                Derivation
                1. Initial program 98.7%

                  \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                2. Add Preprocessing
                3. Taylor expanded in v around inf

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v}} \]
                4. Step-by-step derivation
                  1. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                  2. lower-/.f32N/A

                    \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                  3. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                  4. lower-*.f32N/A

                    \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                  5. lower-*.f3258.5

                    \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot 0.5}{v} \]
                5. Applied rewrites58.5%

                  \[\leadsto \color{blue}{\frac{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot 0.5}{v}} \]
                6. Step-by-step derivation
                  1. Applied rewrites59.0%

                    \[\leadsto \frac{\frac{1}{v}}{\color{blue}{\frac{2}{cosTheta\_O \cdot cosTheta\_i}}} \]
                  2. Add Preprocessing

                  Alternative 13: 59.0% accurate, 9.7× speedup?

                  \[\begin{array}{l} \\ \frac{0.5}{\frac{v}{cosTheta\_O \cdot cosTheta\_i}} \end{array} \]
                  (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
                   :precision binary32
                   (/ 0.5 (/ v (* cosTheta_O cosTheta_i))))
                  float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
                  	return 0.5f / (v / (cosTheta_O * cosTheta_i));
                  }
                  
                  real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
                      real(4), intent (in) :: costheta_i
                      real(4), intent (in) :: costheta_o
                      real(4), intent (in) :: sintheta_i
                      real(4), intent (in) :: sintheta_o
                      real(4), intent (in) :: v
                      code = 0.5e0 / (v / (costheta_o * costheta_i))
                  end function
                  
                  function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                  	return Float32(Float32(0.5) / Float32(v / Float32(cosTheta_O * cosTheta_i)))
                  end
                  
                  function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                  	tmp = single(0.5) / (v / (cosTheta_O * cosTheta_i));
                  end
                  
                  \begin{array}{l}
                  
                  \\
                  \frac{0.5}{\frac{v}{cosTheta\_O \cdot cosTheta\_i}}
                  \end{array}
                  
                  Derivation
                  1. Initial program 98.7%

                    \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                  2. Add Preprocessing
                  3. Taylor expanded in v around inf

                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v}} \]
                  4. Step-by-step derivation
                    1. associate-*r/N/A

                      \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                    2. lower-/.f32N/A

                      \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                    3. *-commutativeN/A

                      \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                    4. lower-*.f32N/A

                      \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                    5. lower-*.f3258.5

                      \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot 0.5}{v} \]
                  5. Applied rewrites58.5%

                    \[\leadsto \color{blue}{\frac{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot 0.5}{v}} \]
                  6. Step-by-step derivation
                    1. Applied rewrites58.9%

                      \[\leadsto \frac{0.5}{\color{blue}{\frac{v}{cosTheta\_O \cdot cosTheta\_i}}} \]
                    2. Add Preprocessing

                    Alternative 14: 58.5% accurate, 12.4× speedup?

                    \[\begin{array}{l} \\ \left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{0.5}{v} \end{array} \]
                    (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
                     :precision binary32
                     (* (* cosTheta_O cosTheta_i) (/ 0.5 v)))
                    float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
                    	return (cosTheta_O * cosTheta_i) * (0.5f / v);
                    }
                    
                    real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
                        real(4), intent (in) :: costheta_i
                        real(4), intent (in) :: costheta_o
                        real(4), intent (in) :: sintheta_i
                        real(4), intent (in) :: sintheta_o
                        real(4), intent (in) :: v
                        code = (costheta_o * costheta_i) * (0.5e0 / v)
                    end function
                    
                    function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                    	return Float32(Float32(cosTheta_O * cosTheta_i) * Float32(Float32(0.5) / v))
                    end
                    
                    function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                    	tmp = (cosTheta_O * cosTheta_i) * (single(0.5) / v);
                    end
                    
                    \begin{array}{l}
                    
                    \\
                    \left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{0.5}{v}
                    \end{array}
                    
                    Derivation
                    1. Initial program 98.7%

                      \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                    2. Add Preprocessing
                    3. Taylor expanded in v around inf

                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v}} \]
                    4. Step-by-step derivation
                      1. associate-*r/N/A

                        \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                      2. lower-/.f32N/A

                        \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                      3. *-commutativeN/A

                        \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                      4. lower-*.f32N/A

                        \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                      5. lower-*.f3258.5

                        \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot 0.5}{v} \]
                    5. Applied rewrites58.5%

                      \[\leadsto \color{blue}{\frac{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot 0.5}{v}} \]
                    6. Step-by-step derivation
                      1. Applied rewrites58.5%

                        \[\leadsto \frac{0.5}{v} \cdot \color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \]
                      2. Final simplification58.5%

                        \[\leadsto \left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{0.5}{v} \]
                      3. Add Preprocessing

                      Alternative 15: 58.5% accurate, 12.4× speedup?

                      \[\begin{array}{l} \\ 0.5 \cdot \left(cosTheta\_i \cdot \frac{cosTheta\_O}{v}\right) \end{array} \]
                      (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
                       :precision binary32
                       (* 0.5 (* cosTheta_i (/ cosTheta_O v))))
                      float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
                      	return 0.5f * (cosTheta_i * (cosTheta_O / v));
                      }
                      
                      real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
                          real(4), intent (in) :: costheta_i
                          real(4), intent (in) :: costheta_o
                          real(4), intent (in) :: sintheta_i
                          real(4), intent (in) :: sintheta_o
                          real(4), intent (in) :: v
                          code = 0.5e0 * (costheta_i * (costheta_o / v))
                      end function
                      
                      function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                      	return Float32(Float32(0.5) * Float32(cosTheta_i * Float32(cosTheta_O / v)))
                      end
                      
                      function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                      	tmp = single(0.5) * (cosTheta_i * (cosTheta_O / v));
                      end
                      
                      \begin{array}{l}
                      
                      \\
                      0.5 \cdot \left(cosTheta\_i \cdot \frac{cosTheta\_O}{v}\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 98.7%

                        \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                      2. Add Preprocessing
                      3. Taylor expanded in v around inf

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v}} \]
                      4. Step-by-step derivation
                        1. associate-*r/N/A

                          \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                        2. lower-/.f32N/A

                          \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                        3. *-commutativeN/A

                          \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                        4. lower-*.f32N/A

                          \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                        5. lower-*.f3258.5

                          \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot 0.5}{v} \]
                      5. Applied rewrites58.5%

                        \[\leadsto \color{blue}{\frac{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot 0.5}{v}} \]
                      6. Step-by-step derivation
                        1. Applied rewrites58.5%

                          \[\leadsto \left(cosTheta\_i \cdot \frac{cosTheta\_O}{v}\right) \cdot \color{blue}{0.5} \]
                        2. Final simplification58.5%

                          \[\leadsto 0.5 \cdot \left(cosTheta\_i \cdot \frac{cosTheta\_O}{v}\right) \]
                        3. Add Preprocessing

                        Alternative 16: 58.5% accurate, 12.4× speedup?

                        \[\begin{array}{l} \\ cosTheta\_i \cdot \left(cosTheta\_O \cdot \frac{0.5}{v}\right) \end{array} \]
                        (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
                         :precision binary32
                         (* cosTheta_i (* cosTheta_O (/ 0.5 v))))
                        float code(float cosTheta_i, float cosTheta_O, float sinTheta_i, float sinTheta_O, float v) {
                        	return cosTheta_i * (cosTheta_O * (0.5f / v));
                        }
                        
                        real(4) function code(costheta_i, costheta_o, sintheta_i, sintheta_o, v)
                            real(4), intent (in) :: costheta_i
                            real(4), intent (in) :: costheta_o
                            real(4), intent (in) :: sintheta_i
                            real(4), intent (in) :: sintheta_o
                            real(4), intent (in) :: v
                            code = costheta_i * (costheta_o * (0.5e0 / v))
                        end function
                        
                        function code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                        	return Float32(cosTheta_i * Float32(cosTheta_O * Float32(Float32(0.5) / v)))
                        end
                        
                        function tmp = code(cosTheta_i, cosTheta_O, sinTheta_i, sinTheta_O, v)
                        	tmp = cosTheta_i * (cosTheta_O * (single(0.5) / v));
                        end
                        
                        \begin{array}{l}
                        
                        \\
                        cosTheta\_i \cdot \left(cosTheta\_O \cdot \frac{0.5}{v}\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 98.7%

                          \[\frac{e^{-\frac{sinTheta\_i \cdot sinTheta\_O}{v}} \cdot \frac{cosTheta\_i \cdot cosTheta\_O}{v}}{\left(\sinh \left(\frac{1}{v}\right) \cdot 2\right) \cdot v} \]
                        2. Add Preprocessing
                        3. Taylor expanded in v around inf

                          \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{cosTheta\_O \cdot cosTheta\_i}{v}} \]
                        4. Step-by-step derivation
                          1. associate-*r/N/A

                            \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                          2. lower-/.f32N/A

                            \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(cosTheta\_O \cdot cosTheta\_i\right)}{v}} \]
                          3. *-commutativeN/A

                            \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                          4. lower-*.f32N/A

                            \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot \frac{1}{2}}}{v} \]
                          5. lower-*.f3258.5

                            \[\leadsto \frac{\color{blue}{\left(cosTheta\_O \cdot cosTheta\_i\right)} \cdot 0.5}{v} \]
                        5. Applied rewrites58.5%

                          \[\leadsto \color{blue}{\frac{\left(cosTheta\_O \cdot cosTheta\_i\right) \cdot 0.5}{v}} \]
                        6. Step-by-step derivation
                          1. Applied rewrites58.5%

                            \[\leadsto \left(cosTheta\_i \cdot \frac{cosTheta\_O}{v}\right) \cdot \color{blue}{0.5} \]
                          2. Step-by-step derivation
                            1. Applied rewrites58.5%

                              \[\leadsto \left(cosTheta\_O \cdot \frac{0.5}{v}\right) \cdot \color{blue}{cosTheta\_i} \]
                            2. Final simplification58.5%

                              \[\leadsto cosTheta\_i \cdot \left(cosTheta\_O \cdot \frac{0.5}{v}\right) \]
                            3. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024225 
                            (FPCore (cosTheta_i cosTheta_O sinTheta_i sinTheta_O v)
                              :name "HairBSDF, Mp, upper"
                              :precision binary32
                              :pre (and (and (and (and (and (and (<= -1.0 cosTheta_i) (<= cosTheta_i 1.0)) (and (<= -1.0 cosTheta_O) (<= cosTheta_O 1.0))) (and (<= -1.0 sinTheta_i) (<= sinTheta_i 1.0))) (and (<= -1.0 sinTheta_O) (<= sinTheta_O 1.0))) (< 0.1 v)) (<= v 1.5707964))
                              (/ (* (exp (- (/ (* sinTheta_i sinTheta_O) v))) (/ (* cosTheta_i cosTheta_O) v)) (* (* (sinh (/ 1.0 v)) 2.0) v)))