
(FPCore (x y z) :precision binary64 (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))
double code(double x, double y, double z) {
return x + (exp((y * log((y / (z + 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 = x + (exp((y * log((y / (z + y))))) / y)
end function
public static double code(double x, double y, double z) {
return x + (Math.exp((y * Math.log((y / (z + y))))) / y);
}
def code(x, y, z): return x + (math.exp((y * math.log((y / (z + y))))) / y)
function code(x, y, z) return Float64(x + Float64(exp(Float64(y * log(Float64(y / Float64(z + y))))) / y)) end
function tmp = code(x, y, z) tmp = x + (exp((y * log((y / (z + y))))) / y); end
code[x_, y_, z_] := N[(x + N[(N[Exp[N[(y * N[Log[N[(y / N[(z + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))
double code(double x, double y, double z) {
return x + (exp((y * log((y / (z + 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 = x + (exp((y * log((y / (z + y))))) / y)
end function
public static double code(double x, double y, double z) {
return x + (Math.exp((y * Math.log((y / (z + y))))) / y);
}
def code(x, y, z): return x + (math.exp((y * math.log((y / (z + y))))) / y)
function code(x, y, z) return Float64(x + Float64(exp(Float64(y * log(Float64(y / Float64(z + y))))) / y)) end
function tmp = code(x, y, z) tmp = x + (exp((y * log((y / (z + y))))) / y); end
code[x_, y_, z_] := N[(x + N[(N[Exp[N[(y * N[Log[N[(y / N[(z + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -1e+53) (not (<= y 0.085))) (+ x (/ (exp (- z)) y)) (+ x (/ (pow (exp y) (log (/ y (+ y z)))) y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1e+53) || !(y <= 0.085)) {
tmp = x + (exp(-z) / y);
} else {
tmp = x + (pow(exp(y), log((y / (y + z)))) / 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 ((y <= (-1d+53)) .or. (.not. (y <= 0.085d0))) then
tmp = x + (exp(-z) / y)
else
tmp = x + ((exp(y) ** log((y / (y + z)))) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1e+53) || !(y <= 0.085)) {
tmp = x + (Math.exp(-z) / y);
} else {
tmp = x + (Math.pow(Math.exp(y), Math.log((y / (y + z)))) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1e+53) or not (y <= 0.085): tmp = x + (math.exp(-z) / y) else: tmp = x + (math.pow(math.exp(y), math.log((y / (y + z)))) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1e+53) || !(y <= 0.085)) tmp = Float64(x + Float64(exp(Float64(-z)) / y)); else tmp = Float64(x + Float64((exp(y) ^ log(Float64(y / Float64(y + z)))) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1e+53) || ~((y <= 0.085))) tmp = x + (exp(-z) / y); else tmp = x + ((exp(y) ^ log((y / (y + z)))) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1e+53], N[Not[LessEqual[y, 0.085]], $MachinePrecision]], N[(x + N[(N[Exp[(-z)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Power[N[Exp[y], $MachinePrecision], N[Log[N[(y / N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+53} \lor \neg \left(y \leq 0.085\right):\\
\;\;\;\;x + \frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{{\left(e^{y}\right)}^{\log \left(\frac{y}{y + z}\right)}}{y}\\
\end{array}
\end{array}
if y < -9.9999999999999999e52 or 0.0850000000000000061 < y Initial program 88.2%
*-commutative88.2%
exp-to-pow88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
if -9.9999999999999999e52 < y < 0.0850000000000000061Initial program 87.0%
exp-prod99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.65) (not (<= y 0.01))) (+ x (/ (exp (- z)) y)) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.65) || !(y <= 0.01)) {
tmp = x + (exp(-z) / y);
} else {
tmp = x + (1.0 / 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 ((y <= (-1.65d0)) .or. (.not. (y <= 0.01d0))) then
tmp = x + (exp(-z) / y)
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.65) || !(y <= 0.01)) {
tmp = x + (Math.exp(-z) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.65) or not (y <= 0.01): tmp = x + (math.exp(-z) / y) else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.65) || !(y <= 0.01)) tmp = Float64(x + Float64(exp(Float64(-z)) / y)); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.65) || ~((y <= 0.01))) tmp = x + (exp(-z) / y); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.65], N[Not[LessEqual[y, 0.01]], $MachinePrecision]], N[(x + N[(N[Exp[(-z)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \lor \neg \left(y \leq 0.01\right):\\
\;\;\;\;x + \frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -1.6499999999999999 or 0.0100000000000000002 < y Initial program 89.2%
*-commutative89.2%
exp-to-pow89.2%
+-commutative89.2%
Simplified89.2%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
if -1.6499999999999999 < y < 0.0100000000000000002Initial program 85.6%
exp-prod99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 98.5%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (<= z -500.0) (/ (exp (- z)) y) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -500.0) {
tmp = exp(-z) / y;
} else {
tmp = x + (1.0 / 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 (z <= (-500.0d0)) then
tmp = exp(-z) / y
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -500.0) {
tmp = Math.exp(-z) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -500.0: tmp = math.exp(-z) / y else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -500.0) tmp = Float64(exp(Float64(-z)) / y); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -500.0) tmp = exp(-z) / y; else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -500.0], N[(N[Exp[(-z)], $MachinePrecision] / y), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -500:\\
\;\;\;\;\frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -500Initial program 57.8%
*-commutative57.8%
exp-to-pow57.8%
+-commutative57.8%
Simplified57.8%
Taylor expanded in y around inf 62.1%
mul-1-neg62.1%
Simplified62.1%
Taylor expanded in x around 0 62.1%
if -500 < z Initial program 95.8%
exp-prod99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 96.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ 1.0 y))))
(if (<= y -2.6e+130)
t_0
(if (<= y -1.0)
(+ x (/ (+ 1.0 (* z (+ -1.0 (* z 0.5)))) y))
(if (<= y 6.4e+212) t_0 (+ x (/ (/ (- y (* y z)) y) y)))))))
double code(double x, double y, double z) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -2.6e+130) {
tmp = t_0;
} else if (y <= -1.0) {
tmp = x + ((1.0 + (z * (-1.0 + (z * 0.5)))) / y);
} else if (y <= 6.4e+212) {
tmp = t_0;
} else {
tmp = x + (((y - (y * z)) / 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) :: t_0
real(8) :: tmp
t_0 = x + (1.0d0 / y)
if (y <= (-2.6d+130)) then
tmp = t_0
else if (y <= (-1.0d0)) then
tmp = x + ((1.0d0 + (z * ((-1.0d0) + (z * 0.5d0)))) / y)
else if (y <= 6.4d+212) then
tmp = t_0
else
tmp = x + (((y - (y * z)) / y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -2.6e+130) {
tmp = t_0;
} else if (y <= -1.0) {
tmp = x + ((1.0 + (z * (-1.0 + (z * 0.5)))) / y);
} else if (y <= 6.4e+212) {
tmp = t_0;
} else {
tmp = x + (((y - (y * z)) / y) / y);
}
return tmp;
}
def code(x, y, z): t_0 = x + (1.0 / y) tmp = 0 if y <= -2.6e+130: tmp = t_0 elif y <= -1.0: tmp = x + ((1.0 + (z * (-1.0 + (z * 0.5)))) / y) elif y <= 6.4e+212: tmp = t_0 else: tmp = x + (((y - (y * z)) / y) / y) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(1.0 / y)) tmp = 0.0 if (y <= -2.6e+130) tmp = t_0; elseif (y <= -1.0) tmp = Float64(x + Float64(Float64(1.0 + Float64(z * Float64(-1.0 + Float64(z * 0.5)))) / y)); elseif (y <= 6.4e+212) tmp = t_0; else tmp = Float64(x + Float64(Float64(Float64(y - Float64(y * z)) / y) / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (1.0 / y); tmp = 0.0; if (y <= -2.6e+130) tmp = t_0; elseif (y <= -1.0) tmp = x + ((1.0 + (z * (-1.0 + (z * 0.5)))) / y); elseif (y <= 6.4e+212) tmp = t_0; else tmp = x + (((y - (y * z)) / y) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+130], t$95$0, If[LessEqual[y, -1.0], N[(x + N[(N[(1.0 + N[(z * N[(-1.0 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+212], t$95$0, N[(x + N[(N[(N[(y - N[(y * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1}{y}\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+130}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;x + \frac{1 + z \cdot \left(-1 + z \cdot 0.5\right)}{y}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+212}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y - y \cdot z}{y}}{y}\\
\end{array}
\end{array}
if y < -2.5999999999999998e130 or -1 < y < 6.3999999999999997e212Initial program 87.9%
exp-prod95.7%
+-commutative95.7%
Simplified95.7%
Taylor expanded in y around inf 91.2%
if -2.5999999999999998e130 < y < -1Initial program 96.2%
*-commutative96.2%
exp-to-pow96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in y around inf 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 81.7%
if 6.3999999999999997e212 < y Initial program 72.9%
exp-prod72.9%
+-commutative72.9%
Simplified72.9%
Taylor expanded in y around inf 68.6%
+-commutative68.6%
mul-1-neg68.6%
unsub-neg68.6%
Simplified68.6%
frac-sub54.9%
associate-/r*87.0%
*-un-lft-identity87.0%
*-commutative87.0%
Applied egg-rr87.0%
Final simplification89.7%
(FPCore (x y z) :precision binary64 (if (<= z -1.05e+103) (+ x (/ (+ 1.0 (* z (+ (* z (+ 0.5 (* z -0.16666666666666666))) -1.0))) y)) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.05e+103) {
tmp = x + ((1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0))) / y);
} else {
tmp = x + (1.0 / 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 (z <= (-1.05d+103)) then
tmp = x + ((1.0d0 + (z * ((z * (0.5d0 + (z * (-0.16666666666666666d0)))) + (-1.0d0)))) / y)
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.05e+103) {
tmp = x + ((1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0))) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.05e+103: tmp = x + ((1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0))) / y) else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.05e+103) tmp = Float64(x + Float64(Float64(1.0 + Float64(z * Float64(Float64(z * Float64(0.5 + Float64(z * -0.16666666666666666))) + -1.0))) / y)); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.05e+103) tmp = x + ((1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0))) / y); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.05e+103], N[(x + N[(N[(1.0 + N[(z * N[(N[(z * N[(0.5 + N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+103}:\\
\;\;\;\;x + \frac{1 + z \cdot \left(z \cdot \left(0.5 + z \cdot -0.16666666666666666\right) + -1\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -1.0500000000000001e103Initial program 57.9%
*-commutative57.9%
exp-to-pow57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around inf 65.7%
mul-1-neg65.7%
Simplified65.7%
Taylor expanded in z around 0 65.7%
if -1.0500000000000001e103 < z Initial program 93.0%
exp-prod96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in y around inf 93.5%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (if (<= y 5e+214) (+ x (/ 1.0 y)) (+ x (/ (/ (- y (* y z)) y) y))))
double code(double x, double y, double z) {
double tmp;
if (y <= 5e+214) {
tmp = x + (1.0 / y);
} else {
tmp = x + (((y - (y * z)) / 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 (y <= 5d+214) then
tmp = x + (1.0d0 / y)
else
tmp = x + (((y - (y * z)) / y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 5e+214) {
tmp = x + (1.0 / y);
} else {
tmp = x + (((y - (y * z)) / y) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 5e+214: tmp = x + (1.0 / y) else: tmp = x + (((y - (y * z)) / y) / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 5e+214) tmp = Float64(x + Float64(1.0 / y)); else tmp = Float64(x + Float64(Float64(Float64(y - Float64(y * z)) / y) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 5e+214) tmp = x + (1.0 / y); else tmp = x + (((y - (y * z)) / y) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 5e+214], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - N[(y * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5 \cdot 10^{+214}:\\
\;\;\;\;x + \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y - y \cdot z}{y}}{y}\\
\end{array}
\end{array}
if y < 4.99999999999999953e214Initial program 89.0%
exp-prod95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in y around inf 86.1%
if 4.99999999999999953e214 < y Initial program 72.9%
exp-prod72.9%
+-commutative72.9%
Simplified72.9%
Taylor expanded in y around inf 68.6%
+-commutative68.6%
mul-1-neg68.6%
unsub-neg68.6%
Simplified68.6%
frac-sub54.9%
associate-/r*87.0%
*-un-lft-identity87.0%
*-commutative87.0%
Applied egg-rr87.0%
Final simplification86.2%
(FPCore (x y z) :precision binary64 (if (<= y -3.05e+96) x (if (<= y 2.6e-34) (/ 1.0 y) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.05e+96) {
tmp = x;
} else if (y <= 2.6e-34) {
tmp = 1.0 / y;
} else {
tmp = x;
}
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 (y <= (-3.05d+96)) then
tmp = x
else if (y <= 2.6d-34) then
tmp = 1.0d0 / y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.05e+96) {
tmp = x;
} else if (y <= 2.6e-34) {
tmp = 1.0 / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.05e+96: tmp = x elif y <= 2.6e-34: tmp = 1.0 / y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.05e+96) tmp = x; elseif (y <= 2.6e-34) tmp = Float64(1.0 / y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.05e+96) tmp = x; elseif (y <= 2.6e-34) tmp = 1.0 / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.05e+96], x, If[LessEqual[y, 2.6e-34], N[(1.0 / y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-34}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.04999999999999992e96 or 2.5999999999999999e-34 < y Initial program 88.7%
exp-prod88.6%
+-commutative88.6%
Simplified88.6%
Taylor expanded in x around inf 71.1%
if -3.04999999999999992e96 < y < 2.5999999999999999e-34Initial program 86.6%
exp-prod98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in y around 0 66.5%
(FPCore (x y z) :precision binary64 (+ x (/ 1.0 y)))
double code(double x, double y, double z) {
return x + (1.0 / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (1.0d0 / y)
end function
public static double code(double x, double y, double z) {
return x + (1.0 / y);
}
def code(x, y, z): return x + (1.0 / y)
function code(x, y, z) return Float64(x + Float64(1.0 / y)) end
function tmp = code(x, y, z) tmp = x + (1.0 / y); end
code[x_, y_, z_] := N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{1}{y}
\end{array}
Initial program 87.6%
exp-prod93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in y around inf 84.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 87.6%
exp-prod93.8%
+-commutative93.8%
Simplified93.8%
Taylor expanded in x around inf 47.7%
(FPCore (x y z) :precision binary64 (if (< (/ y (+ z y)) 7.11541576e-315) (+ x (/ (exp (/ -1.0 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y))))
double code(double x, double y, double z) {
double tmp;
if ((y / (z + y)) < 7.11541576e-315) {
tmp = x + (exp((-1.0 / z)) / y);
} else {
tmp = x + (exp(log(pow((y / (y + z)), 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 ((y / (z + y)) < 7.11541576d-315) then
tmp = x + (exp(((-1.0d0) / z)) / y)
else
tmp = x + (exp(log(((y / (y + z)) ** y))) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y / (z + y)) < 7.11541576e-315) {
tmp = x + (Math.exp((-1.0 / z)) / y);
} else {
tmp = x + (Math.exp(Math.log(Math.pow((y / (y + z)), y))) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y / (z + y)) < 7.11541576e-315: tmp = x + (math.exp((-1.0 / z)) / y) else: tmp = x + (math.exp(math.log(math.pow((y / (y + z)), y))) / y) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(y / Float64(z + y)) < 7.11541576e-315) tmp = Float64(x + Float64(exp(Float64(-1.0 / z)) / y)); else tmp = Float64(x + Float64(exp(log((Float64(y / Float64(y + z)) ^ y))) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y / (z + y)) < 7.11541576e-315) tmp = x + (exp((-1.0 / z)) / y); else tmp = x + (exp(log(((y / (y + z)) ^ y))) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[N[(y / N[(z + y), $MachinePrecision]), $MachinePrecision], 7.11541576e-315], N[(x + N[(N[Exp[N[(-1.0 / z), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Exp[N[Log[N[Power[N[(y / N[(y + z), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y}{z + y} < 7.11541576 \cdot 10^{-315}:\\
\;\;\;\;x + \frac{e^{\frac{-1}{z}}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{\log \left({\left(\frac{y}{y + z}\right)}^{y}\right)}}{y}\\
\end{array}
\end{array}
herbie shell --seed 2024146
(FPCore (x y z)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ y (+ z y)) 17788539399477/2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y))))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))