
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
double code(double x, double y, double z) {
return (x * (y - z)) / 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 * (y - z)) / y
end function
public static double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
def code(x, y, z): return (x * (y - z)) / y
function code(x, y, z) return Float64(Float64(x * Float64(y - z)) / y) end
function tmp = code(x, y, z) tmp = (x * (y - z)) / y; end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
double code(double x, double y, double z) {
return (x * (y - z)) / 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 * (y - z)) / y
end function
public static double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
def code(x, y, z): return (x * (y - z)) / y
function code(x, y, z) return Float64(Float64(x * Float64(y - z)) / y) end
function tmp = code(x, y, z) tmp = (x * (y - z)) / y; end
code[x_, y_, z_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{y}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= z -5e+92) (/ (* x (- y z)) y) (* x (/ (- y z) y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5e+92) {
tmp = (x * (y - z)) / y;
} else {
tmp = x * ((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 (z <= (-5d+92)) then
tmp = (x * (y - z)) / y
else
tmp = x * ((y - z) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5e+92) {
tmp = (x * (y - z)) / y;
} else {
tmp = x * ((y - z) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5e+92: tmp = (x * (y - z)) / y else: tmp = x * ((y - z) / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5e+92) tmp = Float64(Float64(x * Float64(y - z)) / y); else tmp = Float64(x * Float64(Float64(y - z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5e+92) tmp = (x * (y - z)) / y; else tmp = x * ((y - z) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5e+92], N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+92}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\end{array}
\end{array}
if z < -5.00000000000000022e92Initial program 94.0%
if -5.00000000000000022e92 < z Initial program 82.5%
*-commutative82.5%
associate-*l/98.5%
*-commutative98.5%
Simplified98.5%
Final simplification97.7%
(FPCore (x y z)
:precision binary64
(if (<= z -4.5e+92)
(* z (/ (- x) y))
(if (or (<= z 2.8e-139) (and (not (<= z 4.05e-115)) (<= z 3.45e-74)))
x
(* x (/ (- z) y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+92) {
tmp = z * (-x / y);
} else if ((z <= 2.8e-139) || (!(z <= 4.05e-115) && (z <= 3.45e-74))) {
tmp = x;
} else {
tmp = x * (-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 (z <= (-4.5d+92)) then
tmp = z * (-x / y)
else if ((z <= 2.8d-139) .or. (.not. (z <= 4.05d-115)) .and. (z <= 3.45d-74)) then
tmp = x
else
tmp = x * (-z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+92) {
tmp = z * (-x / y);
} else if ((z <= 2.8e-139) || (!(z <= 4.05e-115) && (z <= 3.45e-74))) {
tmp = x;
} else {
tmp = x * (-z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.5e+92: tmp = z * (-x / y) elif (z <= 2.8e-139) or (not (z <= 4.05e-115) and (z <= 3.45e-74)): tmp = x else: tmp = x * (-z / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.5e+92) tmp = Float64(z * Float64(Float64(-x) / y)); elseif ((z <= 2.8e-139) || (!(z <= 4.05e-115) && (z <= 3.45e-74))) tmp = x; else tmp = Float64(x * Float64(Float64(-z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e+92) tmp = z * (-x / y); elseif ((z <= 2.8e-139) || (~((z <= 4.05e-115)) && (z <= 3.45e-74))) tmp = x; else tmp = x * (-z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.5e+92], N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.8e-139], And[N[Not[LessEqual[z, 4.05e-115]], $MachinePrecision], LessEqual[z, 3.45e-74]]], x, N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+92}:\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-139} \lor \neg \left(z \leq 4.05 \cdot 10^{-115}\right) \land z \leq 3.45 \cdot 10^{-74}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\end{array}
\end{array}
if z < -4.4999999999999999e92Initial program 94.0%
*-commutative94.0%
associate-*l/82.4%
*-commutative82.4%
div-sub82.4%
*-inverses82.4%
Simplified82.4%
Taylor expanded in z around inf 84.2%
*-commutative84.2%
associate-*r/78.3%
associate-*l*78.3%
neg-mul-178.3%
Simplified78.3%
if -4.4999999999999999e92 < z < 2.7999999999999999e-139 or 4.0499999999999999e-115 < z < 3.4499999999999999e-74Initial program 80.7%
*-commutative80.7%
associate-*l/100.0%
*-commutative100.0%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 75.5%
if 2.7999999999999999e-139 < z < 4.0499999999999999e-115 or 3.4499999999999999e-74 < z Initial program 84.7%
*-commutative84.7%
associate-*l/96.7%
*-commutative96.7%
div-sub96.7%
*-inverses96.7%
Simplified96.7%
Taylor expanded in z around inf 71.6%
mul-1-neg71.6%
*-commutative71.6%
associate-/l*71.3%
associate-/r/74.3%
distribute-rgt-neg-in74.3%
Simplified74.3%
Final simplification75.6%
(FPCore (x y z)
:precision binary64
(if (<= z -4.4e+91)
(* z (/ (- x) y))
(if (<= z 1.38e-139)
x
(if (<= z 5.3e-115)
(/ x (- (/ y z)))
(if (<= z 1.7e-74) x (* x (/ (- z) y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.4e+91) {
tmp = z * (-x / y);
} else if (z <= 1.38e-139) {
tmp = x;
} else if (z <= 5.3e-115) {
tmp = x / -(y / z);
} else if (z <= 1.7e-74) {
tmp = x;
} else {
tmp = x * (-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 (z <= (-4.4d+91)) then
tmp = z * (-x / y)
else if (z <= 1.38d-139) then
tmp = x
else if (z <= 5.3d-115) then
tmp = x / -(y / z)
else if (z <= 1.7d-74) then
tmp = x
else
tmp = x * (-z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.4e+91) {
tmp = z * (-x / y);
} else if (z <= 1.38e-139) {
tmp = x;
} else if (z <= 5.3e-115) {
tmp = x / -(y / z);
} else if (z <= 1.7e-74) {
tmp = x;
} else {
tmp = x * (-z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.4e+91: tmp = z * (-x / y) elif z <= 1.38e-139: tmp = x elif z <= 5.3e-115: tmp = x / -(y / z) elif z <= 1.7e-74: tmp = x else: tmp = x * (-z / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.4e+91) tmp = Float64(z * Float64(Float64(-x) / y)); elseif (z <= 1.38e-139) tmp = x; elseif (z <= 5.3e-115) tmp = Float64(x / Float64(-Float64(y / z))); elseif (z <= 1.7e-74) tmp = x; else tmp = Float64(x * Float64(Float64(-z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.4e+91) tmp = z * (-x / y); elseif (z <= 1.38e-139) tmp = x; elseif (z <= 5.3e-115) tmp = x / -(y / z); elseif (z <= 1.7e-74) tmp = x; else tmp = x * (-z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.4e+91], N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.38e-139], x, If[LessEqual[z, 5.3e-115], N[(x / (-N[(y / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 1.7e-74], x, N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+91}:\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{-139}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{-\frac{y}{z}}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-74}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\end{array}
\end{array}
if z < -4.39999999999999999e91Initial program 94.0%
*-commutative94.0%
associate-*l/82.4%
*-commutative82.4%
div-sub82.4%
*-inverses82.4%
Simplified82.4%
Taylor expanded in z around inf 84.2%
*-commutative84.2%
associate-*r/78.3%
associate-*l*78.3%
neg-mul-178.3%
Simplified78.3%
if -4.39999999999999999e91 < z < 1.3800000000000001e-139 or 5.3e-115 < z < 1.7e-74Initial program 80.7%
*-commutative80.7%
associate-*l/100.0%
*-commutative100.0%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 75.5%
if 1.3800000000000001e-139 < z < 5.3e-115Initial program 86.3%
*-commutative86.3%
associate-*l/99.3%
*-commutative99.3%
div-sub99.3%
*-inverses99.3%
Simplified99.3%
*-inverses99.3%
div-sub99.3%
associate-*r/86.3%
clear-num86.1%
Applied egg-rr86.1%
Taylor expanded in y around 0 72.9%
neg-mul-172.9%
distribute-neg-frac72.9%
Simplified72.9%
clear-num72.9%
neg-mul-172.9%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
associate-*r/72.9%
associate-/l*86.1%
associate-/l/86.1%
neg-mul-186.1%
Simplified86.1%
if 1.7e-74 < z Initial program 84.6%
*-commutative84.6%
associate-*l/96.5%
*-commutative96.5%
div-sub96.5%
*-inverses96.5%
Simplified96.5%
Taylor expanded in z around inf 71.5%
mul-1-neg71.5%
*-commutative71.5%
associate-/l*72.2%
associate-/r/73.4%
distribute-rgt-neg-in73.4%
Simplified73.4%
Final simplification75.6%
(FPCore (x y z)
:precision binary64
(if (<= z -4.4e+91)
(/ z (- (/ y x)))
(if (<= z 2.8e-139)
x
(if (<= z 4.05e-115)
(/ x (- (/ y z)))
(if (<= z 3.1e-74) x (* x (/ (- z) y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.4e+91) {
tmp = z / -(y / x);
} else if (z <= 2.8e-139) {
tmp = x;
} else if (z <= 4.05e-115) {
tmp = x / -(y / z);
} else if (z <= 3.1e-74) {
tmp = x;
} else {
tmp = x * (-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 (z <= (-4.4d+91)) then
tmp = z / -(y / x)
else if (z <= 2.8d-139) then
tmp = x
else if (z <= 4.05d-115) then
tmp = x / -(y / z)
else if (z <= 3.1d-74) then
tmp = x
else
tmp = x * (-z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.4e+91) {
tmp = z / -(y / x);
} else if (z <= 2.8e-139) {
tmp = x;
} else if (z <= 4.05e-115) {
tmp = x / -(y / z);
} else if (z <= 3.1e-74) {
tmp = x;
} else {
tmp = x * (-z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.4e+91: tmp = z / -(y / x) elif z <= 2.8e-139: tmp = x elif z <= 4.05e-115: tmp = x / -(y / z) elif z <= 3.1e-74: tmp = x else: tmp = x * (-z / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.4e+91) tmp = Float64(z / Float64(-Float64(y / x))); elseif (z <= 2.8e-139) tmp = x; elseif (z <= 4.05e-115) tmp = Float64(x / Float64(-Float64(y / z))); elseif (z <= 3.1e-74) tmp = x; else tmp = Float64(x * Float64(Float64(-z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.4e+91) tmp = z / -(y / x); elseif (z <= 2.8e-139) tmp = x; elseif (z <= 4.05e-115) tmp = x / -(y / z); elseif (z <= 3.1e-74) tmp = x; else tmp = x * (-z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.4e+91], N[(z / (-N[(y / x), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 2.8e-139], x, If[LessEqual[z, 4.05e-115], N[(x / (-N[(y / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 3.1e-74], x, N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+91}:\\
\;\;\;\;\frac{z}{-\frac{y}{x}}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-139}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.05 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{-\frac{y}{z}}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-74}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\end{array}
\end{array}
if z < -4.39999999999999999e91Initial program 94.0%
*-commutative94.0%
associate-*l/82.4%
*-commutative82.4%
div-sub82.4%
*-inverses82.4%
Simplified82.4%
Taylor expanded in z around inf 84.2%
*-commutative84.2%
associate-*r/78.3%
associate-*l*78.3%
neg-mul-178.3%
Simplified78.3%
associate-*r/84.2%
distribute-lft-neg-in84.2%
distribute-rgt-neg-out84.2%
associate-/l*78.3%
frac-2neg78.3%
add-sqr-sqrt78.1%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt0.4%
sqrt-unprod37.1%
sqr-neg37.1%
sqrt-unprod44.6%
add-sqr-sqrt78.3%
Applied egg-rr78.3%
if -4.39999999999999999e91 < z < 2.7999999999999999e-139 or 4.0499999999999999e-115 < z < 3.1000000000000002e-74Initial program 80.7%
*-commutative80.7%
associate-*l/100.0%
*-commutative100.0%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 75.5%
if 2.7999999999999999e-139 < z < 4.0499999999999999e-115Initial program 86.3%
*-commutative86.3%
associate-*l/99.3%
*-commutative99.3%
div-sub99.3%
*-inverses99.3%
Simplified99.3%
*-inverses99.3%
div-sub99.3%
associate-*r/86.3%
clear-num86.1%
Applied egg-rr86.1%
Taylor expanded in y around 0 72.9%
neg-mul-172.9%
distribute-neg-frac72.9%
Simplified72.9%
clear-num72.9%
neg-mul-172.9%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
associate-*r/72.9%
associate-/l*86.1%
associate-/l/86.1%
neg-mul-186.1%
Simplified86.1%
if 3.1000000000000002e-74 < z Initial program 84.6%
*-commutative84.6%
associate-*l/96.5%
*-commutative96.5%
div-sub96.5%
*-inverses96.5%
Simplified96.5%
Taylor expanded in z around inf 71.5%
mul-1-neg71.5%
*-commutative71.5%
associate-/l*72.2%
associate-/r/73.4%
distribute-rgt-neg-in73.4%
Simplified73.4%
Final simplification75.6%
(FPCore (x y z)
:precision binary64
(if (<= z -4.5e+92)
(/ (* z (- x)) y)
(if (<= z 2.8e-139)
x
(if (<= z 1.02e-114)
(/ x (- (/ y z)))
(if (<= z 1.6e-78) x (* x (/ (- z) y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+92) {
tmp = (z * -x) / y;
} else if (z <= 2.8e-139) {
tmp = x;
} else if (z <= 1.02e-114) {
tmp = x / -(y / z);
} else if (z <= 1.6e-78) {
tmp = x;
} else {
tmp = x * (-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 (z <= (-4.5d+92)) then
tmp = (z * -x) / y
else if (z <= 2.8d-139) then
tmp = x
else if (z <= 1.02d-114) then
tmp = x / -(y / z)
else if (z <= 1.6d-78) then
tmp = x
else
tmp = x * (-z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+92) {
tmp = (z * -x) / y;
} else if (z <= 2.8e-139) {
tmp = x;
} else if (z <= 1.02e-114) {
tmp = x / -(y / z);
} else if (z <= 1.6e-78) {
tmp = x;
} else {
tmp = x * (-z / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.5e+92: tmp = (z * -x) / y elif z <= 2.8e-139: tmp = x elif z <= 1.02e-114: tmp = x / -(y / z) elif z <= 1.6e-78: tmp = x else: tmp = x * (-z / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.5e+92) tmp = Float64(Float64(z * Float64(-x)) / y); elseif (z <= 2.8e-139) tmp = x; elseif (z <= 1.02e-114) tmp = Float64(x / Float64(-Float64(y / z))); elseif (z <= 1.6e-78) tmp = x; else tmp = Float64(x * Float64(Float64(-z) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e+92) tmp = (z * -x) / y; elseif (z <= 2.8e-139) tmp = x; elseif (z <= 1.02e-114) tmp = x / -(y / z); elseif (z <= 1.6e-78) tmp = x; else tmp = x * (-z / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.5e+92], N[(N[(z * (-x)), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.8e-139], x, If[LessEqual[z, 1.02e-114], N[(x / (-N[(y / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 1.6e-78], x, N[(x * N[((-z) / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+92}:\\
\;\;\;\;\frac{z \cdot \left(-x\right)}{y}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-139}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-114}:\\
\;\;\;\;\frac{x}{-\frac{y}{z}}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-78}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\end{array}
\end{array}
if z < -4.4999999999999999e92Initial program 94.0%
Taylor expanded in y around 0 84.2%
mul-1-neg84.2%
*-commutative84.2%
distribute-rgt-neg-in84.2%
Simplified84.2%
if -4.4999999999999999e92 < z < 2.7999999999999999e-139 or 1.0199999999999999e-114 < z < 1.6e-78Initial program 80.7%
*-commutative80.7%
associate-*l/100.0%
*-commutative100.0%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 75.5%
if 2.7999999999999999e-139 < z < 1.0199999999999999e-114Initial program 86.3%
*-commutative86.3%
associate-*l/99.3%
*-commutative99.3%
div-sub99.3%
*-inverses99.3%
Simplified99.3%
*-inverses99.3%
div-sub99.3%
associate-*r/86.3%
clear-num86.1%
Applied egg-rr86.1%
Taylor expanded in y around 0 72.9%
neg-mul-172.9%
distribute-neg-frac72.9%
Simplified72.9%
clear-num72.9%
neg-mul-172.9%
times-frac85.9%
Applied egg-rr85.9%
associate-*l/85.9%
associate-*r/72.9%
associate-/l*86.1%
associate-/l/86.1%
neg-mul-186.1%
Simplified86.1%
if 1.6e-78 < z Initial program 84.6%
*-commutative84.6%
associate-*l/96.5%
*-commutative96.5%
div-sub96.5%
*-inverses96.5%
Simplified96.5%
Taylor expanded in z around inf 71.5%
mul-1-neg71.5%
*-commutative71.5%
associate-/l*72.2%
associate-/r/73.4%
distribute-rgt-neg-in73.4%
Simplified73.4%
Final simplification76.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.4e+91) (not (<= z 4e-74))) (* z (/ (- x) y)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.4e+91) || !(z <= 4e-74)) {
tmp = z * (-x / 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 ((z <= (-4.4d+91)) .or. (.not. (z <= 4d-74))) then
tmp = z * (-x / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4.4e+91) || !(z <= 4e-74)) {
tmp = z * (-x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.4e+91) or not (z <= 4e-74): tmp = z * (-x / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.4e+91) || !(z <= 4e-74)) tmp = Float64(z * Float64(Float64(-x) / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4.4e+91) || ~((z <= 4e-74))) tmp = z * (-x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.4e+91], N[Not[LessEqual[z, 4e-74]], $MachinePrecision]], N[(z * N[((-x) / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+91} \lor \neg \left(z \leq 4 \cdot 10^{-74}\right):\\
\;\;\;\;z \cdot \frac{-x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.39999999999999999e91 or 3.99999999999999983e-74 < z Initial program 88.0%
*-commutative88.0%
associate-*l/91.5%
*-commutative91.5%
div-sub91.5%
*-inverses91.5%
Simplified91.5%
Taylor expanded in z around inf 76.1%
*-commutative76.1%
associate-*r/73.8%
associate-*l*73.8%
neg-mul-173.8%
Simplified73.8%
if -4.39999999999999999e91 < z < 3.99999999999999983e-74Initial program 81.0%
*-commutative81.0%
associate-*l/99.9%
*-commutative99.9%
div-sub99.9%
*-inverses99.9%
Simplified99.9%
Taylor expanded in z around 0 72.2%
Final simplification73.0%
(FPCore (x y z) :precision binary64 (if (<= x 1.35e+108) x (* y (/ x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.35e+108) {
tmp = x;
} else {
tmp = 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 <= 1.35d+108) then
tmp = x
else
tmp = y * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.35e+108) {
tmp = x;
} else {
tmp = y * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.35e+108: tmp = x else: tmp = y * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.35e+108) tmp = x; else tmp = Float64(y * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.35e+108) tmp = x; else tmp = y * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.35e+108], x, N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+108}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < 1.35e108Initial program 85.4%
*-commutative85.4%
associate-*l/94.9%
*-commutative94.9%
div-sub94.9%
*-inverses94.9%
Simplified94.9%
Taylor expanded in z around 0 49.4%
if 1.35e108 < x Initial program 79.7%
Taylor expanded in y around inf 8.5%
associate-/l*20.2%
associate-/r/29.4%
Applied egg-rr29.4%
Final simplification46.9%
(FPCore (x y z) :precision binary64 (if (<= x 4.8e+134) x (/ y (/ y x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+134) {
tmp = x;
} else {
tmp = 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 (x <= 4.8d+134) then
tmp = x
else
tmp = y / (y / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+134) {
tmp = x;
} else {
tmp = y / (y / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.8e+134: tmp = x else: tmp = y / (y / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.8e+134) tmp = x; else tmp = Float64(y / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.8e+134) tmp = x; else tmp = y / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.8e+134], x, N[(y / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.8 \cdot 10^{+134}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{y}{x}}\\
\end{array}
\end{array}
if x < 4.80000000000000011e134Initial program 85.6%
*-commutative85.6%
associate-*l/94.9%
*-commutative94.9%
div-sub94.9%
*-inverses94.9%
Simplified94.9%
Taylor expanded in z around 0 48.7%
if 4.80000000000000011e134 < x Initial program 77.6%
Taylor expanded in y around inf 9.3%
associate-/l*22.2%
associate-/r/32.4%
Applied egg-rr32.4%
*-commutative32.4%
clear-num32.4%
div-inv32.4%
Applied egg-rr32.4%
Final simplification46.9%
(FPCore (x y z) :precision binary64 (* x (- 1.0 (/ z y))))
double code(double x, double y, double z) {
return x * (1.0 - (z / 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 - (z / y))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (z / y));
}
def code(x, y, z): return x * (1.0 - (z / y))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(z / y))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (z / y)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \frac{z}{y}\right)
\end{array}
Initial program 84.7%
*-commutative84.7%
associate-*l/95.5%
*-commutative95.5%
div-sub95.5%
*-inverses95.5%
Simplified95.5%
Final simplification95.5%
(FPCore (x y z) :precision binary64 (* x (/ (- y z) y)))
double code(double x, double y, double z) {
return x * ((y - z) / 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 * ((y - z) / y)
end function
public static double code(double x, double y, double z) {
return x * ((y - z) / y);
}
def code(x, y, z): return x * ((y - z) / y)
function code(x, y, z) return Float64(x * Float64(Float64(y - z) / y)) end
function tmp = code(x, y, z) tmp = x * ((y - z) / y); end
code[x_, y_, z_] := N[(x * N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{y}
\end{array}
Initial program 84.7%
*-commutative84.7%
associate-*l/95.5%
*-commutative95.5%
Simplified95.5%
Final simplification95.5%
(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 84.7%
*-commutative84.7%
associate-*l/95.5%
*-commutative95.5%
div-sub95.5%
*-inverses95.5%
Simplified95.5%
Taylor expanded in z around 0 45.7%
Final simplification45.7%
(FPCore (x y z) :precision binary64 (if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if (z < -2.060202331921739e+104) {
tmp = x - ((z * x) / y);
} else if (z < 1.6939766013828526e+213) {
tmp = x / (y / (y - z));
} else {
tmp = (y - z) * (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 (z < (-2.060202331921739d+104)) then
tmp = x - ((z * x) / y)
else if (z < 1.6939766013828526d+213) then
tmp = x / (y / (y - z))
else
tmp = (y - z) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < -2.060202331921739e+104) {
tmp = x - ((z * x) / y);
} else if (z < 1.6939766013828526e+213) {
tmp = x / (y / (y - z));
} else {
tmp = (y - z) * (x / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < -2.060202331921739e+104: tmp = x - ((z * x) / y) elif z < 1.6939766013828526e+213: tmp = x / (y / (y - z)) else: tmp = (y - z) * (x / y) return tmp
function code(x, y, z) tmp = 0.0 if (z < -2.060202331921739e+104) tmp = Float64(x - Float64(Float64(z * x) / y)); elseif (z < 1.6939766013828526e+213) tmp = Float64(x / Float64(y / Float64(y - z))); else tmp = Float64(Float64(y - z) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < -2.060202331921739e+104) tmp = x - ((z * x) / y); elseif (z < 1.6939766013828526e+213) tmp = x / (y / (y - z)); else tmp = (y - z) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, -2.060202331921739e+104], N[(x - N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[Less[z, 1.6939766013828526e+213], N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -2.060202331921739 \cdot 10^{+104}:\\
\;\;\;\;x - \frac{z \cdot x}{y}\\
\mathbf{elif}\;z < 1.6939766013828526 \cdot 10^{+213}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\end{array}
\end{array}
herbie shell --seed 2023325
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))