
(FPCore (x y z) :precision binary64 (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))
double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
end function
public static double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
def code(x, y, z): return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
function code(x, y, z) return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0)) end
function tmp = code(x, y, z) tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0); end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))
double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((x * x) + (y * y)) - (z * z)) / (y * 2.0d0)
end function
public static double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
def code(x, y, z): return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
function code(x, y, z) return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0)) end
function tmp = code(x, y, z) tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0); end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\end{array}
(FPCore (x y z) :precision binary64 (* (- (/ (- z x) (/ y (+ z x))) y) -0.5))
double code(double x, double y, double z) {
return (((z - x) / (y / (z + x))) - y) * -0.5;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((z - x) / (y / (z + x))) - y) * (-0.5d0)
end function
public static double code(double x, double y, double z) {
return (((z - x) / (y / (z + x))) - y) * -0.5;
}
def code(x, y, z): return (((z - x) / (y / (z + x))) - y) * -0.5
function code(x, y, z) return Float64(Float64(Float64(Float64(z - x) / Float64(y / Float64(z + x))) - y) * -0.5) end
function tmp = code(x, y, z) tmp = (((z - x) / (y / (z + x))) - y) * -0.5; end
code[x_, y_, z_] := N[(N[(N[(N[(z - x), $MachinePrecision] / N[(y / N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] * -0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{z - x}{\frac{y}{z + x}} - y\right) \cdot -0.5
\end{array}
Initial program 69.7%
sub-neg69.7%
+-commutative69.7%
neg-sub069.7%
associate-+l-69.7%
sub0-neg69.7%
neg-mul-169.7%
*-commutative69.7%
times-frac69.7%
associate--r+69.7%
div-sub69.7%
difference-of-squares74.9%
+-commutative74.9%
associate-*l/76.5%
*-commutative76.5%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (or (<= (* x x) 2e-187)
(and (not (<= (* x x) 4e-129)) (<= (* x x) 1e+46)))
(* -0.5 (- (/ (* z z) y) y))
(* -0.5 (- (* (- z x) (/ x y)) y))))
double code(double x, double y, double z) {
double tmp;
if (((x * x) <= 2e-187) || (!((x * x) <= 4e-129) && ((x * x) <= 1e+46))) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = -0.5 * (((z - x) * (x / y)) - y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((x * x) <= 2d-187) .or. (.not. ((x * x) <= 4d-129)) .and. ((x * x) <= 1d+46)) then
tmp = (-0.5d0) * (((z * z) / y) - y)
else
tmp = (-0.5d0) * (((z - x) * (x / y)) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((x * x) <= 2e-187) || (!((x * x) <= 4e-129) && ((x * x) <= 1e+46))) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = -0.5 * (((z - x) * (x / y)) - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * x) <= 2e-187) or (not ((x * x) <= 4e-129) and ((x * x) <= 1e+46)): tmp = -0.5 * (((z * z) / y) - y) else: tmp = -0.5 * (((z - x) * (x / y)) - y) return tmp
function code(x, y, z) tmp = 0.0 if ((Float64(x * x) <= 2e-187) || (!(Float64(x * x) <= 4e-129) && (Float64(x * x) <= 1e+46))) tmp = Float64(-0.5 * Float64(Float64(Float64(z * z) / y) - y)); else tmp = Float64(-0.5 * Float64(Float64(Float64(z - x) * Float64(x / y)) - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((x * x) <= 2e-187) || (~(((x * x) <= 4e-129)) && ((x * x) <= 1e+46))) tmp = -0.5 * (((z * z) / y) - y); else tmp = -0.5 * (((z - x) * (x / y)) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[N[(x * x), $MachinePrecision], 2e-187], And[N[Not[LessEqual[N[(x * x), $MachinePrecision], 4e-129]], $MachinePrecision], LessEqual[N[(x * x), $MachinePrecision], 1e+46]]], N[(-0.5 * N[(N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(N[(z - x), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-187} \lor \neg \left(x \cdot x \leq 4 \cdot 10^{-129}\right) \land x \cdot x \leq 10^{+46}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z \cdot z}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(\left(z - x\right) \cdot \frac{x}{y} - y\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 2e-187 or 3.9999999999999997e-129 < (*.f64 x x) < 9.9999999999999999e45Initial program 75.5%
sub-neg75.5%
+-commutative75.5%
neg-sub075.5%
associate-+l-75.5%
sub0-neg75.5%
neg-mul-175.5%
*-commutative75.5%
times-frac75.5%
associate--r+75.5%
div-sub75.5%
difference-of-squares75.5%
+-commutative75.5%
associate-*l/77.0%
*-commutative77.0%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 94.5%
unpow294.5%
Simplified94.5%
if 2e-187 < (*.f64 x x) < 3.9999999999999997e-129 or 9.9999999999999999e45 < (*.f64 x x) Initial program 64.0%
sub-neg64.0%
+-commutative64.0%
neg-sub064.0%
associate-+l-64.0%
sub0-neg64.0%
neg-mul-164.0%
*-commutative64.0%
times-frac64.0%
associate--r+64.0%
div-sub64.0%
difference-of-squares74.4%
+-commutative74.4%
associate-*l/76.0%
*-commutative76.0%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 84.3%
Final simplification89.3%
(FPCore (x y z)
:precision binary64
(if (or (<= (* x x) 2e-187)
(and (not (<= (* x x) 4e-129)) (<= (* x x) 1e+46)))
(* -0.5 (- (/ (* z z) y) y))
(* -0.5 (- (/ (- z x) (/ y x)) y))))
double code(double x, double y, double z) {
double tmp;
if (((x * x) <= 2e-187) || (!((x * x) <= 4e-129) && ((x * x) <= 1e+46))) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = -0.5 * (((z - x) / (y / x)) - y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((x * x) <= 2d-187) .or. (.not. ((x * x) <= 4d-129)) .and. ((x * x) <= 1d+46)) then
tmp = (-0.5d0) * (((z * z) / y) - y)
else
tmp = (-0.5d0) * (((z - x) / (y / x)) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((x * x) <= 2e-187) || (!((x * x) <= 4e-129) && ((x * x) <= 1e+46))) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = -0.5 * (((z - x) / (y / x)) - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * x) <= 2e-187) or (not ((x * x) <= 4e-129) and ((x * x) <= 1e+46)): tmp = -0.5 * (((z * z) / y) - y) else: tmp = -0.5 * (((z - x) / (y / x)) - y) return tmp
function code(x, y, z) tmp = 0.0 if ((Float64(x * x) <= 2e-187) || (!(Float64(x * x) <= 4e-129) && (Float64(x * x) <= 1e+46))) tmp = Float64(-0.5 * Float64(Float64(Float64(z * z) / y) - y)); else tmp = Float64(-0.5 * Float64(Float64(Float64(z - x) / Float64(y / x)) - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((x * x) <= 2e-187) || (~(((x * x) <= 4e-129)) && ((x * x) <= 1e+46))) tmp = -0.5 * (((z * z) / y) - y); else tmp = -0.5 * (((z - x) / (y / x)) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[N[(x * x), $MachinePrecision], 2e-187], And[N[Not[LessEqual[N[(x * x), $MachinePrecision], 4e-129]], $MachinePrecision], LessEqual[N[(x * x), $MachinePrecision], 1e+46]]], N[(-0.5 * N[(N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(N[(z - x), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-187} \lor \neg \left(x \cdot x \leq 4 \cdot 10^{-129}\right) \land x \cdot x \leq 10^{+46}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z \cdot z}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z - x}{\frac{y}{x}} - y\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 2e-187 or 3.9999999999999997e-129 < (*.f64 x x) < 9.9999999999999999e45Initial program 75.5%
sub-neg75.5%
+-commutative75.5%
neg-sub075.5%
associate-+l-75.5%
sub0-neg75.5%
neg-mul-175.5%
*-commutative75.5%
times-frac75.5%
associate--r+75.5%
div-sub75.5%
difference-of-squares75.5%
+-commutative75.5%
associate-*l/77.0%
*-commutative77.0%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 94.5%
unpow294.5%
Simplified94.5%
if 2e-187 < (*.f64 x x) < 3.9999999999999997e-129 or 9.9999999999999999e45 < (*.f64 x x) Initial program 64.0%
sub-neg64.0%
+-commutative64.0%
neg-sub064.0%
associate-+l-64.0%
sub0-neg64.0%
neg-mul-164.0%
*-commutative64.0%
times-frac64.0%
associate--r+64.0%
div-sub64.0%
difference-of-squares74.4%
+-commutative74.4%
associate-*l/76.0%
*-commutative76.0%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 84.3%
Final simplification89.4%
(FPCore (x y z)
:precision binary64
(if (or (<= (* x x) 2e-187)
(and (not (<= (* x x) 4e-129)) (<= (* x x) 4e+55)))
(* -0.5 (- (/ (* z z) y) y))
(* -0.5 (- (* (/ x y) (- x)) y))))
double code(double x, double y, double z) {
double tmp;
if (((x * x) <= 2e-187) || (!((x * x) <= 4e-129) && ((x * x) <= 4e+55))) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = -0.5 * (((x / y) * -x) - y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((x * x) <= 2d-187) .or. (.not. ((x * x) <= 4d-129)) .and. ((x * x) <= 4d+55)) then
tmp = (-0.5d0) * (((z * z) / y) - y)
else
tmp = (-0.5d0) * (((x / y) * -x) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((x * x) <= 2e-187) || (!((x * x) <= 4e-129) && ((x * x) <= 4e+55))) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = -0.5 * (((x / y) * -x) - y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * x) <= 2e-187) or (not ((x * x) <= 4e-129) and ((x * x) <= 4e+55)): tmp = -0.5 * (((z * z) / y) - y) else: tmp = -0.5 * (((x / y) * -x) - y) return tmp
function code(x, y, z) tmp = 0.0 if ((Float64(x * x) <= 2e-187) || (!(Float64(x * x) <= 4e-129) && (Float64(x * x) <= 4e+55))) tmp = Float64(-0.5 * Float64(Float64(Float64(z * z) / y) - y)); else tmp = Float64(-0.5 * Float64(Float64(Float64(x / y) * Float64(-x)) - y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((x * x) <= 2e-187) || (~(((x * x) <= 4e-129)) && ((x * x) <= 4e+55))) tmp = -0.5 * (((z * z) / y) - y); else tmp = -0.5 * (((x / y) * -x) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[N[(x * x), $MachinePrecision], 2e-187], And[N[Not[LessEqual[N[(x * x), $MachinePrecision], 4e-129]], $MachinePrecision], LessEqual[N[(x * x), $MachinePrecision], 4e+55]]], N[(-0.5 * N[(N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(N[(x / y), $MachinePrecision] * (-x)), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-187} \lor \neg \left(x \cdot x \leq 4 \cdot 10^{-129}\right) \land x \cdot x \leq 4 \cdot 10^{+55}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z \cdot z}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(\frac{x}{y} \cdot \left(-x\right) - y\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 2e-187 or 3.9999999999999997e-129 < (*.f64 x x) < 4.00000000000000004e55Initial program 75.6%
sub-neg75.6%
+-commutative75.6%
neg-sub075.6%
associate-+l-75.6%
sub0-neg75.6%
neg-mul-175.6%
*-commutative75.6%
times-frac75.6%
associate--r+75.6%
div-sub75.6%
difference-of-squares75.6%
+-commutative75.6%
associate-*l/77.1%
*-commutative77.1%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 94.5%
unpow294.5%
Simplified94.5%
if 2e-187 < (*.f64 x x) < 3.9999999999999997e-129 or 4.00000000000000004e55 < (*.f64 x x) Initial program 63.8%
sub-neg63.8%
+-commutative63.8%
neg-sub063.8%
associate-+l-63.8%
sub0-neg63.8%
neg-mul-163.8%
*-commutative63.8%
times-frac63.8%
associate--r+63.8%
div-sub63.8%
difference-of-squares74.2%
+-commutative74.2%
associate-*l/75.8%
*-commutative75.8%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 69.0%
unpow269.0%
associate-*r/69.0%
mul-1-neg69.0%
distribute-rgt-neg-out69.0%
associate-*l/80.4%
Simplified80.4%
Final simplification87.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -0.5 (- (/ (* z z) y) y))))
(if (<= (* x x) 2e-187)
t_0
(if (<= (* x x) 4e-129)
(* -0.5 (- (- y) (/ (* x x) y)))
(if (<= (* x x) 4e+55) t_0 (* -0.5 (- (* (/ x y) (- x)) y)))))))
double code(double x, double y, double z) {
double t_0 = -0.5 * (((z * z) / y) - y);
double tmp;
if ((x * x) <= 2e-187) {
tmp = t_0;
} else if ((x * x) <= 4e-129) {
tmp = -0.5 * (-y - ((x * x) / y));
} else if ((x * x) <= 4e+55) {
tmp = t_0;
} else {
tmp = -0.5 * (((x / y) * -x) - y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-0.5d0) * (((z * z) / y) - y)
if ((x * x) <= 2d-187) then
tmp = t_0
else if ((x * x) <= 4d-129) then
tmp = (-0.5d0) * (-y - ((x * x) / y))
else if ((x * x) <= 4d+55) then
tmp = t_0
else
tmp = (-0.5d0) * (((x / y) * -x) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -0.5 * (((z * z) / y) - y);
double tmp;
if ((x * x) <= 2e-187) {
tmp = t_0;
} else if ((x * x) <= 4e-129) {
tmp = -0.5 * (-y - ((x * x) / y));
} else if ((x * x) <= 4e+55) {
tmp = t_0;
} else {
tmp = -0.5 * (((x / y) * -x) - y);
}
return tmp;
}
def code(x, y, z): t_0 = -0.5 * (((z * z) / y) - y) tmp = 0 if (x * x) <= 2e-187: tmp = t_0 elif (x * x) <= 4e-129: tmp = -0.5 * (-y - ((x * x) / y)) elif (x * x) <= 4e+55: tmp = t_0 else: tmp = -0.5 * (((x / y) * -x) - y) return tmp
function code(x, y, z) t_0 = Float64(-0.5 * Float64(Float64(Float64(z * z) / y) - y)) tmp = 0.0 if (Float64(x * x) <= 2e-187) tmp = t_0; elseif (Float64(x * x) <= 4e-129) tmp = Float64(-0.5 * Float64(Float64(-y) - Float64(Float64(x * x) / y))); elseif (Float64(x * x) <= 4e+55) tmp = t_0; else tmp = Float64(-0.5 * Float64(Float64(Float64(x / y) * Float64(-x)) - y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -0.5 * (((z * z) / y) - y); tmp = 0.0; if ((x * x) <= 2e-187) tmp = t_0; elseif ((x * x) <= 4e-129) tmp = -0.5 * (-y - ((x * x) / y)); elseif ((x * x) <= 4e+55) tmp = t_0; else tmp = -0.5 * (((x / y) * -x) - y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-0.5 * N[(N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 2e-187], t$95$0, If[LessEqual[N[(x * x), $MachinePrecision], 4e-129], N[(-0.5 * N[((-y) - N[(N[(x * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 4e+55], t$95$0, N[(-0.5 * N[(N[(N[(x / y), $MachinePrecision] * (-x)), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(\frac{z \cdot z}{y} - y\right)\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-187}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 4 \cdot 10^{-129}:\\
\;\;\;\;-0.5 \cdot \left(\left(-y\right) - \frac{x \cdot x}{y}\right)\\
\mathbf{elif}\;x \cdot x \leq 4 \cdot 10^{+55}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(\frac{x}{y} \cdot \left(-x\right) - y\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 2e-187 or 3.9999999999999997e-129 < (*.f64 x x) < 4.00000000000000004e55Initial program 75.6%
sub-neg75.6%
+-commutative75.6%
neg-sub075.6%
associate-+l-75.6%
sub0-neg75.6%
neg-mul-175.6%
*-commutative75.6%
times-frac75.6%
associate--r+75.6%
div-sub75.6%
difference-of-squares75.6%
+-commutative75.6%
associate-*l/77.1%
*-commutative77.1%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 94.5%
unpow294.5%
Simplified94.5%
if 2e-187 < (*.f64 x x) < 3.9999999999999997e-129Initial program 74.6%
sub-neg74.6%
+-commutative74.6%
neg-sub074.6%
associate-+l-74.6%
sub0-neg74.6%
neg-mul-174.6%
*-commutative74.6%
times-frac74.6%
associate--r+74.6%
div-sub74.6%
difference-of-squares74.6%
+-commutative74.6%
associate-*l/74.8%
*-commutative74.8%
associate-/l*99.8%
*-inverses99.8%
/-rgt-identity99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 84.3%
mul-1-neg84.3%
unpow284.3%
distribute-neg-frac84.3%
Simplified84.3%
if 4.00000000000000004e55 < (*.f64 x x) Initial program 61.9%
sub-neg61.9%
+-commutative61.9%
neg-sub061.9%
associate-+l-61.9%
sub0-neg61.9%
neg-mul-161.9%
*-commutative61.9%
times-frac61.9%
associate--r+61.9%
div-sub61.9%
difference-of-squares74.1%
+-commutative74.1%
associate-*l/75.9%
*-commutative75.9%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 66.3%
unpow266.3%
associate-*r/66.3%
mul-1-neg66.3%
distribute-rgt-neg-out66.3%
associate-*l/79.7%
Simplified79.7%
Final simplification87.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -0.5 (* z (/ z y)))))
(if (<= y -5.6e+42)
(* y 0.5)
(if (<= y 1.08e-67)
t_0
(if (<= y 1.8e-22)
(* x (* x (/ 0.5 y)))
(if (<= y 3.4e+43) t_0 (* y 0.5)))))))
double code(double x, double y, double z) {
double t_0 = -0.5 * (z * (z / y));
double tmp;
if (y <= -5.6e+42) {
tmp = y * 0.5;
} else if (y <= 1.08e-67) {
tmp = t_0;
} else if (y <= 1.8e-22) {
tmp = x * (x * (0.5 / y));
} else if (y <= 3.4e+43) {
tmp = t_0;
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-0.5d0) * (z * (z / y))
if (y <= (-5.6d+42)) then
tmp = y * 0.5d0
else if (y <= 1.08d-67) then
tmp = t_0
else if (y <= 1.8d-22) then
tmp = x * (x * (0.5d0 / y))
else if (y <= 3.4d+43) then
tmp = t_0
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -0.5 * (z * (z / y));
double tmp;
if (y <= -5.6e+42) {
tmp = y * 0.5;
} else if (y <= 1.08e-67) {
tmp = t_0;
} else if (y <= 1.8e-22) {
tmp = x * (x * (0.5 / y));
} else if (y <= 3.4e+43) {
tmp = t_0;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y, z): t_0 = -0.5 * (z * (z / y)) tmp = 0 if y <= -5.6e+42: tmp = y * 0.5 elif y <= 1.08e-67: tmp = t_0 elif y <= 1.8e-22: tmp = x * (x * (0.5 / y)) elif y <= 3.4e+43: tmp = t_0 else: tmp = y * 0.5 return tmp
function code(x, y, z) t_0 = Float64(-0.5 * Float64(z * Float64(z / y))) tmp = 0.0 if (y <= -5.6e+42) tmp = Float64(y * 0.5); elseif (y <= 1.08e-67) tmp = t_0; elseif (y <= 1.8e-22) tmp = Float64(x * Float64(x * Float64(0.5 / y))); elseif (y <= 3.4e+43) tmp = t_0; else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -0.5 * (z * (z / y)); tmp = 0.0; if (y <= -5.6e+42) tmp = y * 0.5; elseif (y <= 1.08e-67) tmp = t_0; elseif (y <= 1.8e-22) tmp = x * (x * (0.5 / y)); elseif (y <= 3.4e+43) tmp = t_0; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-0.5 * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.6e+42], N[(y * 0.5), $MachinePrecision], If[LessEqual[y, 1.08e-67], t$95$0, If[LessEqual[y, 1.8e-22], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+43], t$95$0, N[(y * 0.5), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{+42}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;y \leq 1.08 \cdot 10^{-67}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-22}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+43}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < -5.5999999999999999e42 or 3.40000000000000012e43 < y Initial program 44.2%
Taylor expanded in y around inf 74.3%
*-commutative74.3%
Simplified74.3%
if -5.5999999999999999e42 < y < 1.0800000000000001e-67 or 1.7999999999999999e-22 < y < 3.40000000000000012e43Initial program 88.8%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
unpow257.4%
associate-/l*58.1%
Simplified58.1%
associate-/r/58.1%
Applied egg-rr58.1%
if 1.0800000000000001e-67 < y < 1.7999999999999999e-22Initial program 100.0%
Taylor expanded in x around inf 71.0%
unpow271.0%
Simplified71.0%
div-inv70.9%
associate-*l*70.7%
*-commutative70.7%
associate-/r*70.7%
metadata-eval70.7%
Applied egg-rr70.7%
Final simplification65.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -0.5 (* z (/ z y)))))
(if (<= y -3.3e+42)
(* y 0.5)
(if (<= y 6.8e-71)
t_0
(if (<= y 9.5e-22)
(* x (/ x (* y 2.0)))
(if (<= y 2.8e+43) t_0 (* y 0.5)))))))
double code(double x, double y, double z) {
double t_0 = -0.5 * (z * (z / y));
double tmp;
if (y <= -3.3e+42) {
tmp = y * 0.5;
} else if (y <= 6.8e-71) {
tmp = t_0;
} else if (y <= 9.5e-22) {
tmp = x * (x / (y * 2.0));
} else if (y <= 2.8e+43) {
tmp = t_0;
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-0.5d0) * (z * (z / y))
if (y <= (-3.3d+42)) then
tmp = y * 0.5d0
else if (y <= 6.8d-71) then
tmp = t_0
else if (y <= 9.5d-22) then
tmp = x * (x / (y * 2.0d0))
else if (y <= 2.8d+43) then
tmp = t_0
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -0.5 * (z * (z / y));
double tmp;
if (y <= -3.3e+42) {
tmp = y * 0.5;
} else if (y <= 6.8e-71) {
tmp = t_0;
} else if (y <= 9.5e-22) {
tmp = x * (x / (y * 2.0));
} else if (y <= 2.8e+43) {
tmp = t_0;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y, z): t_0 = -0.5 * (z * (z / y)) tmp = 0 if y <= -3.3e+42: tmp = y * 0.5 elif y <= 6.8e-71: tmp = t_0 elif y <= 9.5e-22: tmp = x * (x / (y * 2.0)) elif y <= 2.8e+43: tmp = t_0 else: tmp = y * 0.5 return tmp
function code(x, y, z) t_0 = Float64(-0.5 * Float64(z * Float64(z / y))) tmp = 0.0 if (y <= -3.3e+42) tmp = Float64(y * 0.5); elseif (y <= 6.8e-71) tmp = t_0; elseif (y <= 9.5e-22) tmp = Float64(x * Float64(x / Float64(y * 2.0))); elseif (y <= 2.8e+43) tmp = t_0; else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -0.5 * (z * (z / y)); tmp = 0.0; if (y <= -3.3e+42) tmp = y * 0.5; elseif (y <= 6.8e-71) tmp = t_0; elseif (y <= 9.5e-22) tmp = x * (x / (y * 2.0)); elseif (y <= 2.8e+43) tmp = t_0; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-0.5 * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e+42], N[(y * 0.5), $MachinePrecision], If[LessEqual[y, 6.8e-71], t$95$0, If[LessEqual[y, 9.5e-22], N[(x * N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+43], t$95$0, N[(y * 0.5), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+42}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-22}:\\
\;\;\;\;x \cdot \frac{x}{y \cdot 2}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+43}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < -3.2999999999999999e42 or 2.80000000000000019e43 < y Initial program 44.2%
Taylor expanded in y around inf 74.3%
*-commutative74.3%
Simplified74.3%
if -3.2999999999999999e42 < y < 6.80000000000000007e-71 or 9.4999999999999994e-22 < y < 2.80000000000000019e43Initial program 88.8%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
unpow257.4%
associate-/l*58.1%
Simplified58.1%
associate-/r/58.1%
Applied egg-rr58.1%
if 6.80000000000000007e-71 < y < 9.4999999999999994e-22Initial program 100.0%
Taylor expanded in x around inf 71.0%
unpow271.0%
Simplified71.0%
associate-/l*71.0%
associate-/r/71.0%
Applied egg-rr71.0%
Final simplification65.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -0.5 (* z (/ z y)))))
(if (<= y -1.55e+43)
(* y 0.5)
(if (<= y 1.25e-69)
t_0
(if (<= y 1.35e-22)
(/ (* x x) (* y 2.0))
(if (<= y 1.3e+44) t_0 (* y 0.5)))))))
double code(double x, double y, double z) {
double t_0 = -0.5 * (z * (z / y));
double tmp;
if (y <= -1.55e+43) {
tmp = y * 0.5;
} else if (y <= 1.25e-69) {
tmp = t_0;
} else if (y <= 1.35e-22) {
tmp = (x * x) / (y * 2.0);
} else if (y <= 1.3e+44) {
tmp = t_0;
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-0.5d0) * (z * (z / y))
if (y <= (-1.55d+43)) then
tmp = y * 0.5d0
else if (y <= 1.25d-69) then
tmp = t_0
else if (y <= 1.35d-22) then
tmp = (x * x) / (y * 2.0d0)
else if (y <= 1.3d+44) then
tmp = t_0
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -0.5 * (z * (z / y));
double tmp;
if (y <= -1.55e+43) {
tmp = y * 0.5;
} else if (y <= 1.25e-69) {
tmp = t_0;
} else if (y <= 1.35e-22) {
tmp = (x * x) / (y * 2.0);
} else if (y <= 1.3e+44) {
tmp = t_0;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y, z): t_0 = -0.5 * (z * (z / y)) tmp = 0 if y <= -1.55e+43: tmp = y * 0.5 elif y <= 1.25e-69: tmp = t_0 elif y <= 1.35e-22: tmp = (x * x) / (y * 2.0) elif y <= 1.3e+44: tmp = t_0 else: tmp = y * 0.5 return tmp
function code(x, y, z) t_0 = Float64(-0.5 * Float64(z * Float64(z / y))) tmp = 0.0 if (y <= -1.55e+43) tmp = Float64(y * 0.5); elseif (y <= 1.25e-69) tmp = t_0; elseif (y <= 1.35e-22) tmp = Float64(Float64(x * x) / Float64(y * 2.0)); elseif (y <= 1.3e+44) tmp = t_0; else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -0.5 * (z * (z / y)); tmp = 0.0; if (y <= -1.55e+43) tmp = y * 0.5; elseif (y <= 1.25e-69) tmp = t_0; elseif (y <= 1.35e-22) tmp = (x * x) / (y * 2.0); elseif (y <= 1.3e+44) tmp = t_0; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-0.5 * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+43], N[(y * 0.5), $MachinePrecision], If[LessEqual[y, 1.25e-69], t$95$0, If[LessEqual[y, 1.35e-22], N[(N[(x * x), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+44], t$95$0, N[(y * 0.5), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(z \cdot \frac{z}{y}\right)\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+43}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-69}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-22}:\\
\;\;\;\;\frac{x \cdot x}{y \cdot 2}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < -1.5500000000000001e43 or 1.3e44 < y Initial program 44.2%
Taylor expanded in y around inf 74.3%
*-commutative74.3%
Simplified74.3%
if -1.5500000000000001e43 < y < 1.25000000000000008e-69 or 1.3500000000000001e-22 < y < 1.3e44Initial program 88.8%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
unpow257.4%
associate-/l*58.1%
Simplified58.1%
associate-/r/58.1%
Applied egg-rr58.1%
if 1.25000000000000008e-69 < y < 1.3500000000000001e-22Initial program 100.0%
Taylor expanded in x around inf 71.0%
unpow271.0%
Simplified71.0%
Final simplification65.7%
(FPCore (x y z) :precision binary64 (if (<= (* x x) 1e+269) (* -0.5 (- (/ (* z z) y) y)) (* x (* x (/ 0.5 y)))))
double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 1e+269) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x * x) <= 1d+269) then
tmp = (-0.5d0) * (((z * z) / y) - y)
else
tmp = x * (x * (0.5d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x * x) <= 1e+269) {
tmp = -0.5 * (((z * z) / y) - y);
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x * x) <= 1e+269: tmp = -0.5 * (((z * z) / y) - y) else: tmp = x * (x * (0.5 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(x * x) <= 1e+269) tmp = Float64(-0.5 * Float64(Float64(Float64(z * z) / y) - y)); else tmp = Float64(x * Float64(x * Float64(0.5 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x * x) <= 1e+269) tmp = -0.5 * (((z * z) / y) - y); else tmp = x * (x * (0.5 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e+269], N[(-0.5 * N[(N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{+269}:\\
\;\;\;\;-0.5 \cdot \left(\frac{z \cdot z}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 1e269Initial program 75.8%
sub-neg75.8%
+-commutative75.8%
neg-sub075.8%
associate-+l-75.8%
sub0-neg75.8%
neg-mul-175.8%
*-commutative75.8%
times-frac75.8%
associate--r+75.8%
div-sub75.8%
difference-of-squares75.8%
+-commutative75.8%
associate-*l/76.9%
*-commutative76.9%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 84.4%
unpow284.4%
Simplified84.4%
if 1e269 < (*.f64 x x) Initial program 52.8%
Taylor expanded in x around inf 57.9%
unpow257.9%
Simplified57.9%
div-inv57.9%
associate-*l*67.3%
*-commutative67.3%
associate-/r*67.3%
metadata-eval67.3%
Applied egg-rr67.3%
Final simplification79.9%
(FPCore (x y z) :precision binary64 (* -0.5 (- (* (- z x) (/ (+ z x) y)) y)))
double code(double x, double y, double z) {
return -0.5 * (((z - x) * ((z + x) / y)) - y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (-0.5d0) * (((z - x) * ((z + x) / y)) - y)
end function
public static double code(double x, double y, double z) {
return -0.5 * (((z - x) * ((z + x) / y)) - y);
}
def code(x, y, z): return -0.5 * (((z - x) * ((z + x) / y)) - y)
function code(x, y, z) return Float64(-0.5 * Float64(Float64(Float64(z - x) * Float64(Float64(z + x) / y)) - y)) end
function tmp = code(x, y, z) tmp = -0.5 * (((z - x) * ((z + x) / y)) - y); end
code[x_, y_, z_] := N[(-0.5 * N[(N[(N[(z - x), $MachinePrecision] * N[(N[(z + x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.5 \cdot \left(\left(z - x\right) \cdot \frac{z + x}{y} - y\right)
\end{array}
Initial program 69.7%
sub-neg69.7%
+-commutative69.7%
neg-sub069.7%
associate-+l-69.7%
sub0-neg69.7%
neg-mul-169.7%
*-commutative69.7%
times-frac69.7%
associate--r+69.7%
div-sub69.7%
difference-of-squares74.9%
+-commutative74.9%
associate-*l/76.5%
*-commutative76.5%
associate-/l*99.9%
*-inverses99.9%
/-rgt-identity99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= x 3.7e+96) (* y 0.5) (* x (* x (/ 0.5 y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.7e+96) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 3.7d+96) then
tmp = y * 0.5d0
else
tmp = x * (x * (0.5d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.7e+96) {
tmp = y * 0.5;
} else {
tmp = x * (x * (0.5 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.7e+96: tmp = y * 0.5 else: tmp = x * (x * (0.5 / y)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.7e+96) tmp = Float64(y * 0.5); else tmp = Float64(x * Float64(x * Float64(0.5 / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.7e+96) tmp = y * 0.5; else tmp = x * (x * (0.5 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.7e+96], N[(y * 0.5), $MachinePrecision], N[(x * N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.7 \cdot 10^{+96}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \frac{0.5}{y}\right)\\
\end{array}
\end{array}
if x < 3.69999999999999991e96Initial program 72.1%
Taylor expanded in y around inf 43.4%
*-commutative43.4%
Simplified43.4%
if 3.69999999999999991e96 < x Initial program 57.1%
Taylor expanded in x around inf 53.0%
unpow253.0%
Simplified53.0%
div-inv53.0%
associate-*l*61.9%
*-commutative61.9%
associate-/r*61.9%
metadata-eval61.9%
Applied egg-rr61.9%
Final simplification46.3%
(FPCore (x y z) :precision binary64 (* y 0.5))
double code(double x, double y, double z) {
return y * 0.5;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * 0.5d0
end function
public static double code(double x, double y, double z) {
return y * 0.5;
}
def code(x, y, z): return y * 0.5
function code(x, y, z) return Float64(y * 0.5) end
function tmp = code(x, y, z) tmp = y * 0.5; end
code[x_, y_, z_] := N[(y * 0.5), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 0.5
\end{array}
Initial program 69.7%
Taylor expanded in y around inf 39.0%
*-commutative39.0%
Simplified39.0%
Final simplification39.0%
(FPCore (x y z) :precision binary64 (- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x))))
double code(double x, double y, double z) {
return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y * 0.5d0) - (((0.5d0 / y) * (z + x)) * (z - x))
end function
public static double code(double x, double y, double z) {
return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x));
}
def code(x, y, z): return (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x))
function code(x, y, z) return Float64(Float64(y * 0.5) - Float64(Float64(Float64(0.5 / y) * Float64(z + x)) * Float64(z - x))) end
function tmp = code(x, y, z) tmp = (y * 0.5) - (((0.5 / y) * (z + x)) * (z - x)); end
code[x_, y_, z_] := N[(N[(y * 0.5), $MachinePrecision] - N[(N[(N[(0.5 / y), $MachinePrecision] * N[(z + x), $MachinePrecision]), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right)
\end{array}
herbie shell --seed 2023257
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"
:precision binary64
:herbie-target
(- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))
(/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))