
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + (y * (z - x))) / z
end function
public static double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
def code(x, y, z): return (x + (y * (z - x))) / z
function code(x, y, z) return Float64(Float64(x + Float64(y * Float64(z - x))) / z) end
function tmp = code(x, y, z) tmp = (x + (y * (z - x))) / z; end
code[x_, y_, z_] := N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \left(z - x\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + (y * (z - x))) / z
end function
public static double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
def code(x, y, z): return (x + (y * (z - x))) / z
function code(x, y, z) return Float64(Float64(x + Float64(y * Float64(z - x))) / z) end
function tmp = code(x, y, z) tmp = (x + (y * (z - x))) / z; end
code[x_, y_, z_] := N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \left(z - x\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -9.4e-204) (not (<= z 3.2e+23))) (+ (/ x z) (* y (- 1.0 (/ x z)))) (/ (+ x (* y (- z x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.4e-204) || !(z <= 3.2e+23)) {
tmp = (x / z) + (y * (1.0 - (x / z)));
} else {
tmp = (x + (y * (z - x))) / z;
}
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 <= (-9.4d-204)) .or. (.not. (z <= 3.2d+23))) then
tmp = (x / z) + (y * (1.0d0 - (x / z)))
else
tmp = (x + (y * (z - x))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9.4e-204) || !(z <= 3.2e+23)) {
tmp = (x / z) + (y * (1.0 - (x / z)));
} else {
tmp = (x + (y * (z - x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.4e-204) or not (z <= 3.2e+23): tmp = (x / z) + (y * (1.0 - (x / z))) else: tmp = (x + (y * (z - x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.4e-204) || !(z <= 3.2e+23)) tmp = Float64(Float64(x / z) + Float64(y * Float64(1.0 - Float64(x / z)))); else tmp = Float64(Float64(x + Float64(y * Float64(z - x))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9.4e-204) || ~((z <= 3.2e+23))) tmp = (x / z) + (y * (1.0 - (x / z))); else tmp = (x + (y * (z - x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.4e-204], N[Not[LessEqual[z, 3.2e+23]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] + N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.4 \cdot 10^{-204} \lor \neg \left(z \leq 3.2 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{z} + y \cdot \left(1 - \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}
\end{array}
if z < -9.39999999999999983e-204 or 3.2e23 < z Initial program 77.8%
Taylor expanded in y around 0 100.0%
if -9.39999999999999983e-204 < z < 3.2e23Initial program 99.9%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.1e+174) (and (not (<= y -2.9e+100)) (<= y 8.1e+46))) (+ y (/ x z)) (* y (- (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.1e+174) || (!(y <= -2.9e+100) && (y <= 8.1e+46))) {
tmp = y + (x / z);
} else {
tmp = y * -(x / z);
}
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 <= (-4.1d+174)) .or. (.not. (y <= (-2.9d+100))) .and. (y <= 8.1d+46)) then
tmp = y + (x / z)
else
tmp = y * -(x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.1e+174) || (!(y <= -2.9e+100) && (y <= 8.1e+46))) {
tmp = y + (x / z);
} else {
tmp = y * -(x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.1e+174) or (not (y <= -2.9e+100) and (y <= 8.1e+46)): tmp = y + (x / z) else: tmp = y * -(x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.1e+174) || (!(y <= -2.9e+100) && (y <= 8.1e+46))) tmp = Float64(y + Float64(x / z)); else tmp = Float64(y * Float64(-Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.1e+174) || (~((y <= -2.9e+100)) && (y <= 8.1e+46))) tmp = y + (x / z); else tmp = y * -(x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.1e+174], And[N[Not[LessEqual[y, -2.9e+100]], $MachinePrecision], LessEqual[y, 8.1e+46]]], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y * (-N[(x / z), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+174} \lor \neg \left(y \leq -2.9 \cdot 10^{+100}\right) \land y \leq 8.1 \cdot 10^{+46}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\
\end{array}
\end{array}
if y < -4.1000000000000003e174 or -2.9e100 < y < 8.10000000000000048e46Initial program 91.7%
Taylor expanded in y around 0 94.7%
Taylor expanded in x around 0 91.0%
if -4.1000000000000003e174 < y < -2.9e100 or 8.10000000000000048e46 < y Initial program 67.6%
Taylor expanded in y around inf 67.6%
associate-/l*99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in x around inf 56.2%
mul-1-neg56.2%
distribute-frac-neg256.2%
*-commutative56.2%
associate-*r/63.6%
Simplified63.6%
Final simplification84.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -8e+41) (not (<= y 1.15e+29))) (* y (- 1.0 (/ x z))) (/ (+ x (* y (- z x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+41) || !(y <= 1.15e+29)) {
tmp = y * (1.0 - (x / z));
} else {
tmp = (x + (y * (z - x))) / z;
}
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 <= (-8d+41)) .or. (.not. (y <= 1.15d+29))) then
tmp = y * (1.0d0 - (x / z))
else
tmp = (x + (y * (z - x))) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -8e+41) || !(y <= 1.15e+29)) {
tmp = y * (1.0 - (x / z));
} else {
tmp = (x + (y * (z - x))) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -8e+41) or not (y <= 1.15e+29): tmp = y * (1.0 - (x / z)) else: tmp = (x + (y * (z - x))) / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -8e+41) || !(y <= 1.15e+29)) tmp = Float64(y * Float64(1.0 - Float64(x / z))); else tmp = Float64(Float64(x + Float64(y * Float64(z - x))) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -8e+41) || ~((y <= 1.15e+29))) tmp = y * (1.0 - (x / z)); else tmp = (x + (y * (z - x))) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -8e+41], N[Not[LessEqual[y, 1.15e+29]], $MachinePrecision]], N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+41} \lor \neg \left(y \leq 1.15 \cdot 10^{+29}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}
\end{array}
if y < -8.00000000000000005e41 or 1.1500000000000001e29 < y Initial program 67.3%
Taylor expanded in y around inf 67.3%
associate-/l*99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
if -8.00000000000000005e41 < y < 1.1500000000000001e29Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 102000.0))) (* y (- 1.0 (/ x z))) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 102000.0)) {
tmp = y * (1.0 - (x / z));
} else {
tmp = y + (x / z);
}
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.0d0)) .or. (.not. (y <= 102000.0d0))) then
tmp = y * (1.0d0 - (x / z))
else
tmp = y + (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 102000.0)) {
tmp = y * (1.0 - (x / z));
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.0) or not (y <= 102000.0): tmp = y * (1.0 - (x / z)) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 102000.0)) tmp = Float64(y * Float64(1.0 - Float64(x / z))); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.0) || ~((y <= 102000.0))) tmp = y * (1.0 - (x / z)); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 102000.0]], $MachinePrecision]], N[(y * N[(1.0 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 102000\right):\\
\;\;\;\;y \cdot \left(1 - \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if y < -1 or 102000 < y Initial program 70.4%
Taylor expanded in y around inf 70.0%
associate-/l*99.5%
div-sub99.5%
*-inverses99.5%
Simplified99.5%
if -1 < y < 102000Initial program 99.9%
Taylor expanded in y around 0 92.4%
Taylor expanded in x around 0 99.0%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.1e+106) (not (<= x 5.8e-13))) (* x (/ (- 1.0 y) z)) (+ y (/ x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.1e+106) || !(x <= 5.8e-13)) {
tmp = x * ((1.0 - y) / z);
} else {
tmp = y + (x / z);
}
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 <= (-2.1d+106)) .or. (.not. (x <= 5.8d-13))) then
tmp = x * ((1.0d0 - y) / z)
else
tmp = y + (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.1e+106) || !(x <= 5.8e-13)) {
tmp = x * ((1.0 - y) / z);
} else {
tmp = y + (x / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.1e+106) or not (x <= 5.8e-13): tmp = x * ((1.0 - y) / z) else: tmp = y + (x / z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.1e+106) || !(x <= 5.8e-13)) tmp = Float64(x * Float64(Float64(1.0 - y) / z)); else tmp = Float64(y + Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.1e+106) || ~((x <= 5.8e-13))) tmp = x * ((1.0 - y) / z); else tmp = y + (x / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.1e+106], N[Not[LessEqual[x, 5.8e-13]], $MachinePrecision]], N[(x * N[(N[(1.0 - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+106} \lor \neg \left(x \leq 5.8 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \frac{1 - y}{z}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{x}{z}\\
\end{array}
\end{array}
if x < -2.10000000000000005e106 or 5.7999999999999995e-13 < x Initial program 87.5%
Taylor expanded in x around inf 83.7%
associate-/l*88.9%
mul-1-neg88.9%
unsub-neg88.9%
Simplified88.9%
if -2.10000000000000005e106 < x < 5.7999999999999995e-13Initial program 84.4%
Taylor expanded in y around 0 98.6%
Taylor expanded in x around 0 87.8%
Final simplification88.3%
(FPCore (x y z) :precision binary64 (if (<= y 3.5e+66) (+ y (/ x z)) (if (<= y 3.5e+129) (* x (/ (- y) z)) (/ z (/ z y)))))
double code(double x, double y, double z) {
double tmp;
if (y <= 3.5e+66) {
tmp = y + (x / z);
} else if (y <= 3.5e+129) {
tmp = x * (-y / z);
} else {
tmp = z / (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 <= 3.5d+66) then
tmp = y + (x / z)
else if (y <= 3.5d+129) then
tmp = x * (-y / z)
else
tmp = z / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 3.5e+66) {
tmp = y + (x / z);
} else if (y <= 3.5e+129) {
tmp = x * (-y / z);
} else {
tmp = z / (z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 3.5e+66: tmp = y + (x / z) elif y <= 3.5e+129: tmp = x * (-y / z) else: tmp = z / (z / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 3.5e+66) tmp = Float64(y + Float64(x / z)); elseif (y <= 3.5e+129) tmp = Float64(x * Float64(Float64(-y) / z)); else tmp = Float64(z / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 3.5e+66) tmp = y + (x / z); elseif (y <= 3.5e+129) tmp = x * (-y / z); else tmp = z / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 3.5e+66], N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+129], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], N[(z / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{+66}:\\
\;\;\;\;y + \frac{x}{z}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+129}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < 3.4999999999999997e66Initial program 91.7%
Taylor expanded in y around 0 95.1%
Taylor expanded in x around 0 87.9%
if 3.4999999999999997e66 < y < 3.4999999999999998e129Initial program 66.0%
Taylor expanded in y around inf 66.0%
associate-/l*99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in x around inf 51.9%
associate-*r/51.9%
mul-1-neg51.9%
distribute-rgt-neg-in51.9%
associate-*r/71.9%
Simplified71.9%
if 3.4999999999999998e129 < y Initial program 58.4%
Taylor expanded in x around 0 12.7%
*-commutative12.7%
associate-/l*56.8%
Applied egg-rr56.8%
clear-num56.8%
un-div-inv56.9%
Applied egg-rr56.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -15.5) (not (<= y 1.65e-48))) (* z (/ y z)) (/ x z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -15.5) || !(y <= 1.65e-48)) {
tmp = z * (y / z);
} else {
tmp = x / z;
}
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 <= (-15.5d0)) .or. (.not. (y <= 1.65d-48))) then
tmp = z * (y / z)
else
tmp = x / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -15.5) || !(y <= 1.65e-48)) {
tmp = z * (y / z);
} else {
tmp = x / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -15.5) or not (y <= 1.65e-48): tmp = z * (y / z) else: tmp = x / z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -15.5) || !(y <= 1.65e-48)) tmp = Float64(z * Float64(y / z)); else tmp = Float64(x / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -15.5) || ~((y <= 1.65e-48))) tmp = z * (y / z); else tmp = x / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -15.5], N[Not[LessEqual[y, 1.65e-48]], $MachinePrecision]], N[(z * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -15.5 \lor \neg \left(y \leq 1.65 \cdot 10^{-48}\right):\\
\;\;\;\;z \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\
\end{array}
\end{array}
if y < -15.5 or 1.65e-48 < y Initial program 71.6%
Taylor expanded in x around 0 29.5%
*-commutative29.5%
associate-/l*57.0%
Applied egg-rr57.0%
if -15.5 < y < 1.65e-48Initial program 99.9%
Taylor expanded in y around 0 77.6%
Final simplification67.3%
(FPCore (x y z) :precision binary64 (if (<= y -6.0) y (if (<= y 6.3e-49) (/ x z) y)))
double code(double x, double y, double z) {
double tmp;
if (y <= -6.0) {
tmp = y;
} else if (y <= 6.3e-49) {
tmp = x / z;
} else {
tmp = 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 <= (-6.0d0)) then
tmp = y
else if (y <= 6.3d-49) then
tmp = x / z
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6.0) {
tmp = y;
} else if (y <= 6.3e-49) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6.0: tmp = y elif y <= 6.3e-49: tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6.0) tmp = y; elseif (y <= 6.3e-49) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6.0) tmp = y; elseif (y <= 6.3e-49) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6.0], y, If[LessEqual[y, 6.3e-49], N[(x / z), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 6.3 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -6 or 6.2999999999999997e-49 < y Initial program 71.6%
Taylor expanded in x around 0 52.8%
if -6 < y < 6.2999999999999997e-49Initial program 99.9%
Taylor expanded in y around 0 77.6%
(FPCore (x y z) :precision binary64 (+ y (/ x z)))
double code(double x, double y, double z) {
return y + (x / z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y + (x / z)
end function
public static double code(double x, double y, double z) {
return y + (x / z);
}
def code(x, y, z): return y + (x / z)
function code(x, y, z) return Float64(y + Float64(x / z)) end
function tmp = code(x, y, z) tmp = y + (x / z); end
code[x_, y_, z_] := N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \frac{x}{z}
\end{array}
Initial program 85.6%
Taylor expanded in y around 0 93.7%
Taylor expanded in x around 0 79.2%
(FPCore (x y z) :precision binary64 y)
double code(double x, double y, double z) {
return y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y
end function
public static double code(double x, double y, double z) {
return y;
}
def code(x, y, z): return y
function code(x, y, z) return y end
function tmp = code(x, y, z) tmp = y; end
code[x_, y_, z_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 85.6%
Taylor expanded in x around 0 38.4%
(FPCore (x y z) :precision binary64 (- (+ y (/ x z)) (/ y (/ z x))))
double code(double x, double y, double z) {
return (y + (x / z)) - (y / (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 + (x / z)) - (y / (z / x))
end function
public static double code(double x, double y, double z) {
return (y + (x / z)) - (y / (z / x));
}
def code(x, y, z): return (y + (x / z)) - (y / (z / x))
function code(x, y, z) return Float64(Float64(y + Float64(x / z)) - Float64(y / Float64(z / x))) end
function tmp = code(x, y, z) tmp = (y + (x / z)) - (y / (z / x)); end
code[x_, y_, z_] := N[(N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision] - N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}}
\end{array}
herbie shell --seed 2024103
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
:precision binary64
:alt
(- (+ y (/ x z)) (/ y (/ z x)))
(/ (+ x (* y (- z x))) z))