
(FPCore (x y z) :precision binary64 (* (/ 1.0 2.0) (+ x (* y (sqrt z)))))
double code(double x, double y, double z) {
return (1.0 / 2.0) * (x + (y * sqrt(z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (1.0d0 / 2.0d0) * (x + (y * sqrt(z)))
end function
public static double code(double x, double y, double z) {
return (1.0 / 2.0) * (x + (y * Math.sqrt(z)));
}
def code(x, y, z): return (1.0 / 2.0) * (x + (y * math.sqrt(z)))
function code(x, y, z) return Float64(Float64(1.0 / 2.0) * Float64(x + Float64(y * sqrt(z)))) end
function tmp = code(x, y, z) tmp = (1.0 / 2.0) * (x + (y * sqrt(z))); end
code[x_, y_, z_] := N[(N[(1.0 / 2.0), $MachinePrecision] * N[(x + N[(y * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{2} \cdot \left(x + y \cdot \sqrt{z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* (/ 1.0 2.0) (+ x (* y (sqrt z)))))
double code(double x, double y, double z) {
return (1.0 / 2.0) * (x + (y * sqrt(z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (1.0d0 / 2.0d0) * (x + (y * sqrt(z)))
end function
public static double code(double x, double y, double z) {
return (1.0 / 2.0) * (x + (y * Math.sqrt(z)));
}
def code(x, y, z): return (1.0 / 2.0) * (x + (y * math.sqrt(z)))
function code(x, y, z) return Float64(Float64(1.0 / 2.0) * Float64(x + Float64(y * sqrt(z)))) end
function tmp = code(x, y, z) tmp = (1.0 / 2.0) * (x + (y * sqrt(z))); end
code[x_, y_, z_] := N[(N[(1.0 / 2.0), $MachinePrecision] * N[(x + N[(y * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{2} \cdot \left(x + y \cdot \sqrt{z}\right)
\end{array}
(FPCore (x y z) :precision binary64 (* (+ (/ y (pow z -0.5)) x) 0.5))
double code(double x, double y, double z) {
return ((y / pow(z, -0.5)) + x) * 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 / (z ** (-0.5d0))) + x) * 0.5d0
end function
public static double code(double x, double y, double z) {
return ((y / Math.pow(z, -0.5)) + x) * 0.5;
}
def code(x, y, z): return ((y / math.pow(z, -0.5)) + x) * 0.5
function code(x, y, z) return Float64(Float64(Float64(y / (z ^ -0.5)) + x) * 0.5) end
function tmp = code(x, y, z) tmp = ((y / (z ^ -0.5)) + x) * 0.5; end
code[x_, y_, z_] := N[(N[(N[(y / N[Power[z, -0.5], $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{y}{{z}^{-0.5}} + x\right) \cdot 0.5
\end{array}
Initial program 99.8%
Simplified0
Applied egg-rr0
Applied egg-rr0
Applied egg-rr0
(FPCore (x y z) :precision binary64 (let* ((t_0 (* y (sqrt z))) (t_1 (/ (* y 0.5) (pow z -0.5)))) (if (<= t_0 -100.0) t_1 (if (<= t_0 2e+32) (* x 0.5) t_1))))
double code(double x, double y, double z) {
double t_0 = y * sqrt(z);
double t_1 = (y * 0.5) / pow(z, -0.5);
double tmp;
if (t_0 <= -100.0) {
tmp = t_1;
} else if (t_0 <= 2e+32) {
tmp = x * 0.5;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = y * sqrt(z)
t_1 = (y * 0.5d0) / (z ** (-0.5d0))
if (t_0 <= (-100.0d0)) then
tmp = t_1
else if (t_0 <= 2d+32) then
tmp = x * 0.5d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * Math.sqrt(z);
double t_1 = (y * 0.5) / Math.pow(z, -0.5);
double tmp;
if (t_0 <= -100.0) {
tmp = t_1;
} else if (t_0 <= 2e+32) {
tmp = x * 0.5;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * math.sqrt(z) t_1 = (y * 0.5) / math.pow(z, -0.5) tmp = 0 if t_0 <= -100.0: tmp = t_1 elif t_0 <= 2e+32: tmp = x * 0.5 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * sqrt(z)) t_1 = Float64(Float64(y * 0.5) / (z ^ -0.5)) tmp = 0.0 if (t_0 <= -100.0) tmp = t_1; elseif (t_0 <= 2e+32) tmp = Float64(x * 0.5); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * sqrt(z); t_1 = (y * 0.5) / (z ^ -0.5); tmp = 0.0; if (t_0 <= -100.0) tmp = t_1; elseif (t_0 <= 2e+32) tmp = x * 0.5; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * 0.5), $MachinePrecision] / N[Power[z, -0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -100.0], t$95$1, If[LessEqual[t$95$0, 2e+32], N[(x * 0.5), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{z}\\
t_1 := \frac{y \cdot 0.5}{{z}^{-0.5}}\\
\mathbf{if}\;t\_0 \leq -100:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+32}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y (sqrt.f64 z)) < -100 or 2.00000000000000011e32 < (*.f64 y (sqrt.f64 z)) Initial program 99.7%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -100 < (*.f64 y (sqrt.f64 z)) < 2.00000000000000011e32Initial program 99.9%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (sqrt z))))
(if (<= t_0 -100.0)
(* t_0 0.5)
(if (<= t_0 2e+32) (* x 0.5) (/ 0.5 (/ (pow z -0.5) y))))))
double code(double x, double y, double z) {
double t_0 = y * sqrt(z);
double tmp;
if (t_0 <= -100.0) {
tmp = t_0 * 0.5;
} else if (t_0 <= 2e+32) {
tmp = x * 0.5;
} else {
tmp = 0.5 / (pow(z, -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) :: t_0
real(8) :: tmp
t_0 = y * sqrt(z)
if (t_0 <= (-100.0d0)) then
tmp = t_0 * 0.5d0
else if (t_0 <= 2d+32) then
tmp = x * 0.5d0
else
tmp = 0.5d0 / ((z ** (-0.5d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * Math.sqrt(z);
double tmp;
if (t_0 <= -100.0) {
tmp = t_0 * 0.5;
} else if (t_0 <= 2e+32) {
tmp = x * 0.5;
} else {
tmp = 0.5 / (Math.pow(z, -0.5) / y);
}
return tmp;
}
def code(x, y, z): t_0 = y * math.sqrt(z) tmp = 0 if t_0 <= -100.0: tmp = t_0 * 0.5 elif t_0 <= 2e+32: tmp = x * 0.5 else: tmp = 0.5 / (math.pow(z, -0.5) / y) return tmp
function code(x, y, z) t_0 = Float64(y * sqrt(z)) tmp = 0.0 if (t_0 <= -100.0) tmp = Float64(t_0 * 0.5); elseif (t_0 <= 2e+32) tmp = Float64(x * 0.5); else tmp = Float64(0.5 / Float64((z ^ -0.5) / y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * sqrt(z); tmp = 0.0; if (t_0 <= -100.0) tmp = t_0 * 0.5; elseif (t_0 <= 2e+32) tmp = x * 0.5; else tmp = 0.5 / ((z ^ -0.5) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -100.0], N[(t$95$0 * 0.5), $MachinePrecision], If[LessEqual[t$95$0, 2e+32], N[(x * 0.5), $MachinePrecision], N[(0.5 / N[(N[Power[z, -0.5], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{z}\\
\mathbf{if}\;t\_0 \leq -100:\\
\;\;\;\;t\_0 \cdot 0.5\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+32}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{{z}^{-0.5}}{y}}\\
\end{array}
\end{array}
if (*.f64 y (sqrt.f64 z)) < -100Initial program 99.6%
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -100 < (*.f64 y (sqrt.f64 z)) < 2.00000000000000011e32Initial program 99.9%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 2.00000000000000011e32 < (*.f64 y (sqrt.f64 z)) Initial program 99.7%
Simplified0
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z) :precision binary64 (let* ((t_0 (* y (sqrt z))) (t_1 (* t_0 0.5))) (if (<= t_0 -100.0) t_1 (if (<= t_0 2e+32) (* x 0.5) t_1))))
double code(double x, double y, double z) {
double t_0 = y * sqrt(z);
double t_1 = t_0 * 0.5;
double tmp;
if (t_0 <= -100.0) {
tmp = t_1;
} else if (t_0 <= 2e+32) {
tmp = x * 0.5;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = y * sqrt(z)
t_1 = t_0 * 0.5d0
if (t_0 <= (-100.0d0)) then
tmp = t_1
else if (t_0 <= 2d+32) then
tmp = x * 0.5d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * Math.sqrt(z);
double t_1 = t_0 * 0.5;
double tmp;
if (t_0 <= -100.0) {
tmp = t_1;
} else if (t_0 <= 2e+32) {
tmp = x * 0.5;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * math.sqrt(z) t_1 = t_0 * 0.5 tmp = 0 if t_0 <= -100.0: tmp = t_1 elif t_0 <= 2e+32: tmp = x * 0.5 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * sqrt(z)) t_1 = Float64(t_0 * 0.5) tmp = 0.0 if (t_0 <= -100.0) tmp = t_1; elseif (t_0 <= 2e+32) tmp = Float64(x * 0.5); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * sqrt(z); t_1 = t_0 * 0.5; tmp = 0.0; if (t_0 <= -100.0) tmp = t_1; elseif (t_0 <= 2e+32) tmp = x * 0.5; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * 0.5), $MachinePrecision]}, If[LessEqual[t$95$0, -100.0], t$95$1, If[LessEqual[t$95$0, 2e+32], N[(x * 0.5), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{z}\\
t_1 := t\_0 \cdot 0.5\\
\mathbf{if}\;t\_0 \leq -100:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+32}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y (sqrt.f64 z)) < -100 or 2.00000000000000011e32 < (*.f64 y (sqrt.f64 z)) Initial program 99.7%
Simplified0
Taylor expanded in x around 0 0
Simplified0
if -100 < (*.f64 y (sqrt.f64 z)) < 2.00000000000000011e32Initial program 99.9%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (* 0.5 (+ x (* y (sqrt z)))))
double code(double x, double y, double z) {
return 0.5 * (x + (y * sqrt(z)));
}
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 * (x + (y * sqrt(z)))
end function
public static double code(double x, double y, double z) {
return 0.5 * (x + (y * Math.sqrt(z)));
}
def code(x, y, z): return 0.5 * (x + (y * math.sqrt(z)))
function code(x, y, z) return Float64(0.5 * Float64(x + Float64(y * sqrt(z)))) end
function tmp = code(x, y, z) tmp = 0.5 * (x + (y * sqrt(z))); end
code[x_, y_, z_] := N[(0.5 * N[(x + N[(y * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(x + y \cdot \sqrt{z}\right)
\end{array}
Initial program 99.8%
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y -8.1e+183) (/ -1.0 (- 0.0 (/ x (* z (* y (* y -0.5)))))) (* x 0.5)))
double code(double x, double y, double z) {
double tmp;
if (y <= -8.1e+183) {
tmp = -1.0 / (0.0 - (x / (z * (y * (y * -0.5)))));
} else {
tmp = x * 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) :: tmp
if (y <= (-8.1d+183)) then
tmp = (-1.0d0) / (0.0d0 - (x / (z * (y * (y * (-0.5d0))))))
else
tmp = x * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -8.1e+183) {
tmp = -1.0 / (0.0 - (x / (z * (y * (y * -0.5)))));
} else {
tmp = x * 0.5;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8.1e+183: tmp = -1.0 / (0.0 - (x / (z * (y * (y * -0.5))))) else: tmp = x * 0.5 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8.1e+183) tmp = Float64(-1.0 / Float64(0.0 - Float64(x / Float64(z * Float64(y * Float64(y * -0.5)))))); else tmp = Float64(x * 0.5); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -8.1e+183) tmp = -1.0 / (0.0 - (x / (z * (y * (y * -0.5))))); else tmp = x * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8.1e+183], N[(-1.0 / N[(0.0 - N[(x / N[(z * N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.1 \cdot 10^{+183}:\\
\;\;\;\;\frac{-1}{0 - \frac{x}{z \cdot \left(y \cdot \left(y \cdot -0.5\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5\\
\end{array}
\end{array}
if y < -8.09999999999999993e183Initial program 99.7%
Simplified0
Applied egg-rr0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -8.09999999999999993e183 < y Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= z 6e+68) (* x 0.5) (* 0.5 (* z (- (/ x z) (/ (* y y) x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= 6e+68) {
tmp = x * 0.5;
} else {
tmp = 0.5 * (z * ((x / z) - ((y * y) / 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 (z <= 6d+68) then
tmp = x * 0.5d0
else
tmp = 0.5d0 * (z * ((x / z) - ((y * y) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 6e+68) {
tmp = x * 0.5;
} else {
tmp = 0.5 * (z * ((x / z) - ((y * y) / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 6e+68: tmp = x * 0.5 else: tmp = 0.5 * (z * ((x / z) - ((y * y) / x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 6e+68) tmp = Float64(x * 0.5); else tmp = Float64(0.5 * Float64(z * Float64(Float64(x / z) - Float64(Float64(y * y) / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 6e+68) tmp = x * 0.5; else tmp = 0.5 * (z * ((x / z) - ((y * y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 6e+68], N[(x * 0.5), $MachinePrecision], N[(0.5 * N[(z * N[(N[(x / z), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{+68}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(z \cdot \left(\frac{x}{z} - \frac{y \cdot y}{x}\right)\right)\\
\end{array}
\end{array}
if z < 6.0000000000000004e68Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
if 6.0000000000000004e68 < z Initial program 99.8%
Simplified0
Applied egg-rr0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y -2.9e+236) (* (/ (* y -0.5) x) (* y z)) (* x 0.5)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.9e+236) {
tmp = ((y * -0.5) / x) * (y * z);
} else {
tmp = x * 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) :: tmp
if (y <= (-2.9d+236)) then
tmp = ((y * (-0.5d0)) / x) * (y * z)
else
tmp = x * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.9e+236) {
tmp = ((y * -0.5) / x) * (y * z);
} else {
tmp = x * 0.5;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.9e+236: tmp = ((y * -0.5) / x) * (y * z) else: tmp = x * 0.5 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.9e+236) tmp = Float64(Float64(Float64(y * -0.5) / x) * Float64(y * z)); else tmp = Float64(x * 0.5); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.9e+236) tmp = ((y * -0.5) / x) * (y * z); else tmp = x * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.9e+236], N[(N[(N[(y * -0.5), $MachinePrecision] / x), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+236}:\\
\;\;\;\;\frac{y \cdot -0.5}{x} \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5\\
\end{array}
\end{array}
if y < -2.9000000000000001e236Initial program 99.7%
Simplified0
Applied egg-rr0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -2.9000000000000001e236 < y Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y -2.8e+234) (* (* z -0.5) (/ y (/ x y))) (* x 0.5)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+234) {
tmp = (z * -0.5) * (y / (x / y));
} else {
tmp = x * 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) :: tmp
if (y <= (-2.8d+234)) then
tmp = (z * (-0.5d0)) * (y / (x / y))
else
tmp = x * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.8e+234) {
tmp = (z * -0.5) * (y / (x / y));
} else {
tmp = x * 0.5;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.8e+234: tmp = (z * -0.5) * (y / (x / y)) else: tmp = x * 0.5 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.8e+234) tmp = Float64(Float64(z * -0.5) * Float64(y / Float64(x / y))); else tmp = Float64(x * 0.5); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.8e+234) tmp = (z * -0.5) * (y / (x / y)); else tmp = x * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.8e+234], N[(N[(z * -0.5), $MachinePrecision] * N[(y / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+234}:\\
\;\;\;\;\left(z \cdot -0.5\right) \cdot \frac{y}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5\\
\end{array}
\end{array}
if y < -2.7999999999999998e234Initial program 99.7%
Simplified0
Applied egg-rr0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -2.7999999999999998e234 < y Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (if (<= y -3.8e+235) (* (* y (* y -0.5)) (/ z x)) (* x 0.5)))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e+235) {
tmp = (y * (y * -0.5)) * (z / x);
} else {
tmp = x * 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) :: tmp
if (y <= (-3.8d+235)) then
tmp = (y * (y * (-0.5d0))) * (z / x)
else
tmp = x * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.8e+235) {
tmp = (y * (y * -0.5)) * (z / x);
} else {
tmp = x * 0.5;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.8e+235: tmp = (y * (y * -0.5)) * (z / x) else: tmp = x * 0.5 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.8e+235) tmp = Float64(Float64(y * Float64(y * -0.5)) * Float64(z / x)); else tmp = Float64(x * 0.5); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.8e+235) tmp = (y * (y * -0.5)) * (z / x); else tmp = x * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.8e+235], N[(N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision], N[(x * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+235}:\\
\;\;\;\;\left(y \cdot \left(y \cdot -0.5\right)\right) \cdot \frac{z}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5\\
\end{array}
\end{array}
if y < -3.79999999999999975e235Initial program 99.7%
Simplified0
Applied egg-rr0
Taylor expanded in x around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -3.79999999999999975e235 < y Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z) :precision binary64 (* x 0.5))
double code(double x, double y, double z) {
return x * 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 = x * 0.5d0
end function
public static double code(double x, double y, double z) {
return x * 0.5;
}
def code(x, y, z): return x * 0.5
function code(x, y, z) return Float64(x * 0.5) end
function tmp = code(x, y, z) tmp = x * 0.5; end
code[x_, y_, z_] := N[(x * 0.5), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.5
\end{array}
Initial program 99.8%
Simplified0
Taylor expanded in x around inf 0
Simplified0
herbie shell --seed 2024111
(FPCore (x y z)
:name "Diagrams.Solve.Polynomial:quadForm from diagrams-solve-0.1, B"
:precision binary64
(* (/ 1.0 2.0) (+ x (* y (sqrt z)))))