
(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 10 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 (/ x (/ y (- y z))))
double code(double x, double y, double z) {
return x / (y / (y - 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 / (y - z))
end function
public static double code(double x, double y, double z) {
return x / (y / (y - z));
}
def code(x, y, z): return x / (y / (y - z))
function code(x, y, z) return Float64(x / Float64(y / Float64(y - z))) end
function tmp = code(x, y, z) tmp = x / (y / (y - z)); end
code[x_, y_, z_] := N[(x / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{y}{y - z}}
\end{array}
Initial program 86.2%
associate-*l/85.5%
Simplified85.5%
associate-/r/97.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.7)
(and (not (<= z 6e-149)) (or (<= z 1.6e+43) (not (<= z 9e+83)))))
(* x (- (/ z y)))
x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.7) || (!(z <= 6e-149) && ((z <= 1.6e+43) || !(z <= 9e+83)))) {
tmp = x * -(z / 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 <= (-1.7d0)) .or. (.not. (z <= 6d-149)) .and. (z <= 1.6d+43) .or. (.not. (z <= 9d+83))) then
tmp = x * -(z / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.7) || (!(z <= 6e-149) && ((z <= 1.6e+43) || !(z <= 9e+83)))) {
tmp = x * -(z / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.7) or (not (z <= 6e-149) and ((z <= 1.6e+43) or not (z <= 9e+83))): tmp = x * -(z / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.7) || (!(z <= 6e-149) && ((z <= 1.6e+43) || !(z <= 9e+83)))) tmp = Float64(x * Float64(-Float64(z / y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.7) || (~((z <= 6e-149)) && ((z <= 1.6e+43) || ~((z <= 9e+83))))) tmp = x * -(z / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.7], And[N[Not[LessEqual[z, 6e-149]], $MachinePrecision], Or[LessEqual[z, 1.6e+43], N[Not[LessEqual[z, 9e+83]], $MachinePrecision]]]], N[(x * (-N[(z / y), $MachinePrecision])), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \lor \neg \left(z \leq 6 \cdot 10^{-149}\right) \land \left(z \leq 1.6 \cdot 10^{+43} \lor \neg \left(z \leq 9 \cdot 10^{+83}\right)\right):\\
\;\;\;\;x \cdot \left(-\frac{z}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.69999999999999996 or 6.0000000000000003e-149 < z < 1.60000000000000007e43 or 8.9999999999999999e83 < z Initial program 92.1%
associate-*l/85.2%
Simplified85.2%
associate-/r/95.7%
Applied egg-rr95.7%
Taylor expanded in y around 0 75.4%
associate-*l/74.6%
associate-*r*74.6%
*-commutative74.6%
mul-1-neg74.6%
Simplified74.6%
if -1.69999999999999996 < z < 6.0000000000000003e-149 or 1.60000000000000007e43 < z < 8.9999999999999999e83Initial program 76.6%
associate-*l/86.0%
Simplified86.0%
Taylor expanded in y around inf 82.7%
Final simplification77.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- (/ z y)))))
(if (<= z -0.72)
t_0
(if (<= z 6e-149)
x
(if (<= z 7.5e+42) (* z (- (/ x y))) (if (<= z 1.9e+83) x t_0))))))
double code(double x, double y, double z) {
double t_0 = x * -(z / y);
double tmp;
if (z <= -0.72) {
tmp = t_0;
} else if (z <= 6e-149) {
tmp = x;
} else if (z <= 7.5e+42) {
tmp = z * -(x / y);
} else if (z <= 1.9e+83) {
tmp = x;
} else {
tmp = t_0;
}
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 * -(z / y)
if (z <= (-0.72d0)) then
tmp = t_0
else if (z <= 6d-149) then
tmp = x
else if (z <= 7.5d+42) then
tmp = z * -(x / y)
else if (z <= 1.9d+83) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * -(z / y);
double tmp;
if (z <= -0.72) {
tmp = t_0;
} else if (z <= 6e-149) {
tmp = x;
} else if (z <= 7.5e+42) {
tmp = z * -(x / y);
} else if (z <= 1.9e+83) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * -(z / y) tmp = 0 if z <= -0.72: tmp = t_0 elif z <= 6e-149: tmp = x elif z <= 7.5e+42: tmp = z * -(x / y) elif z <= 1.9e+83: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-Float64(z / y))) tmp = 0.0 if (z <= -0.72) tmp = t_0; elseif (z <= 6e-149) tmp = x; elseif (z <= 7.5e+42) tmp = Float64(z * Float64(-Float64(x / y))); elseif (z <= 1.9e+83) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * -(z / y); tmp = 0.0; if (z <= -0.72) tmp = t_0; elseif (z <= 6e-149) tmp = x; elseif (z <= 7.5e+42) tmp = z * -(x / y); elseif (z <= 1.9e+83) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * (-N[(z / y), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -0.72], t$95$0, If[LessEqual[z, 6e-149], x, If[LessEqual[z, 7.5e+42], N[(z * (-N[(x / y), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 1.9e+83], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-\frac{z}{y}\right)\\
\mathbf{if}\;z \leq -0.72:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-149}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;z \cdot \left(-\frac{x}{y}\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.71999999999999997 or 1.9000000000000001e83 < z Initial program 92.8%
associate-*l/82.7%
Simplified82.7%
associate-/r/94.4%
Applied egg-rr94.4%
Taylor expanded in y around 0 79.4%
associate-*l/77.5%
associate-*r*77.5%
*-commutative77.5%
mul-1-neg77.5%
Simplified77.5%
if -0.71999999999999997 < z < 6.0000000000000003e-149 or 7.50000000000000041e42 < z < 1.9000000000000001e83Initial program 76.6%
associate-*l/86.0%
Simplified86.0%
Taylor expanded in y around inf 82.7%
if 6.0000000000000003e-149 < z < 7.50000000000000041e42Initial program 90.1%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in y around 0 63.1%
*-commutative63.1%
associate-*r/63.1%
neg-mul-163.1%
distribute-rgt-neg-in63.1%
associate-*l/65.7%
Simplified65.7%
Final simplification77.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ x (/ (- y) z))))
(if (<= z -2.6)
t_0
(if (<= z 6e-149)
x
(if (<= z 6.5e+42) (* z (- (/ x y))) (if (<= z 9.5e+82) x t_0))))))
double code(double x, double y, double z) {
double t_0 = x / (-y / z);
double tmp;
if (z <= -2.6) {
tmp = t_0;
} else if (z <= 6e-149) {
tmp = x;
} else if (z <= 6.5e+42) {
tmp = z * -(x / y);
} else if (z <= 9.5e+82) {
tmp = x;
} else {
tmp = t_0;
}
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 / (-y / z)
if (z <= (-2.6d0)) then
tmp = t_0
else if (z <= 6d-149) then
tmp = x
else if (z <= 6.5d+42) then
tmp = z * -(x / y)
else if (z <= 9.5d+82) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x / (-y / z);
double tmp;
if (z <= -2.6) {
tmp = t_0;
} else if (z <= 6e-149) {
tmp = x;
} else if (z <= 6.5e+42) {
tmp = z * -(x / y);
} else if (z <= 9.5e+82) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x / (-y / z) tmp = 0 if z <= -2.6: tmp = t_0 elif z <= 6e-149: tmp = x elif z <= 6.5e+42: tmp = z * -(x / y) elif z <= 9.5e+82: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x / Float64(Float64(-y) / z)) tmp = 0.0 if (z <= -2.6) tmp = t_0; elseif (z <= 6e-149) tmp = x; elseif (z <= 6.5e+42) tmp = Float64(z * Float64(-Float64(x / y))); elseif (z <= 9.5e+82) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x / (-y / z); tmp = 0.0; if (z <= -2.6) tmp = t_0; elseif (z <= 6e-149) tmp = x; elseif (z <= 6.5e+42) tmp = z * -(x / y); elseif (z <= 9.5e+82) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / N[((-y) / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6], t$95$0, If[LessEqual[z, 6e-149], x, If[LessEqual[z, 6.5e+42], N[(z * (-N[(x / y), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 9.5e+82], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\frac{-y}{z}}\\
\mathbf{if}\;z \leq -2.6:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-149}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+42}:\\
\;\;\;\;z \cdot \left(-\frac{x}{y}\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -2.60000000000000009 or 9.50000000000000049e82 < z Initial program 92.8%
associate-*l/82.7%
Simplified82.7%
associate-/r/94.4%
Applied egg-rr94.4%
Taylor expanded in y around 0 77.6%
associate-*r/77.6%
neg-mul-177.6%
Simplified77.6%
if -2.60000000000000009 < z < 6.0000000000000003e-149 or 6.50000000000000052e42 < z < 9.50000000000000049e82Initial program 76.6%
associate-*l/86.0%
Simplified86.0%
Taylor expanded in y around inf 82.7%
if 6.0000000000000003e-149 < z < 6.50000000000000052e42Initial program 90.1%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in y around 0 63.1%
*-commutative63.1%
associate-*r/63.1%
neg-mul-163.1%
distribute-rgt-neg-in63.1%
associate-*l/65.7%
Simplified65.7%
Final simplification77.7%
(FPCore (x y z)
:precision binary64
(if (<= z -0.125)
(/ x (/ (- y) z))
(if (<= z 6e-149)
x
(if (<= z 1.25e+43)
(* z (- (/ x y)))
(if (<= z 9.5e+82) x (/ (* z (- x)) y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.125) {
tmp = x / (-y / z);
} else if (z <= 6e-149) {
tmp = x;
} else if (z <= 1.25e+43) {
tmp = z * -(x / y);
} else if (z <= 9.5e+82) {
tmp = x;
} else {
tmp = (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 <= (-0.125d0)) then
tmp = x / (-y / z)
else if (z <= 6d-149) then
tmp = x
else if (z <= 1.25d+43) then
tmp = z * -(x / y)
else if (z <= 9.5d+82) then
tmp = x
else
tmp = (z * -x) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.125) {
tmp = x / (-y / z);
} else if (z <= 6e-149) {
tmp = x;
} else if (z <= 1.25e+43) {
tmp = z * -(x / y);
} else if (z <= 9.5e+82) {
tmp = x;
} else {
tmp = (z * -x) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.125: tmp = x / (-y / z) elif z <= 6e-149: tmp = x elif z <= 1.25e+43: tmp = z * -(x / y) elif z <= 9.5e+82: tmp = x else: tmp = (z * -x) / y return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.125) tmp = Float64(x / Float64(Float64(-y) / z)); elseif (z <= 6e-149) tmp = x; elseif (z <= 1.25e+43) tmp = Float64(z * Float64(-Float64(x / y))); elseif (z <= 9.5e+82) tmp = x; else tmp = Float64(Float64(z * Float64(-x)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.125) tmp = x / (-y / z); elseif (z <= 6e-149) tmp = x; elseif (z <= 1.25e+43) tmp = z * -(x / y); elseif (z <= 9.5e+82) tmp = x; else tmp = (z * -x) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.125], N[(x / N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-149], x, If[LessEqual[z, 1.25e+43], N[(z * (-N[(x / y), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 9.5e+82], x, N[(N[(z * (-x)), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.125:\\
\;\;\;\;\frac{x}{\frac{-y}{z}}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-149}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+43}:\\
\;\;\;\;z \cdot \left(-\frac{x}{y}\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(-x\right)}{y}\\
\end{array}
\end{array}
if z < -0.125Initial program 90.7%
associate-*l/88.0%
Simplified88.0%
associate-/r/96.0%
Applied egg-rr96.0%
Taylor expanded in y around 0 78.2%
associate-*r/78.2%
neg-mul-178.2%
Simplified78.2%
if -0.125 < z < 6.0000000000000003e-149 or 1.2500000000000001e43 < z < 9.50000000000000049e82Initial program 76.6%
associate-*l/86.0%
Simplified86.0%
Taylor expanded in y around inf 82.7%
if 6.0000000000000003e-149 < z < 1.2500000000000001e43Initial program 90.1%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in y around 0 63.1%
*-commutative63.1%
associate-*r/63.1%
neg-mul-163.1%
distribute-rgt-neg-in63.1%
associate-*l/65.7%
Simplified65.7%
if 9.50000000000000049e82 < z Initial program 95.9%
Taylor expanded in y around 0 82.6%
mul-1-neg82.6%
distribute-rgt-neg-out82.6%
Simplified82.6%
Final simplification78.8%
(FPCore (x y z) :precision binary64 (if (<= y -8.5e+186) x (if (<= y 9.5e+175) (* (- y z) (/ x y)) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -8.5e+186) {
tmp = x;
} else if (y <= 9.5e+175) {
tmp = (y - 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 (y <= (-8.5d+186)) then
tmp = x
else if (y <= 9.5d+175) then
tmp = (y - 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 (y <= -8.5e+186) {
tmp = x;
} else if (y <= 9.5e+175) {
tmp = (y - z) * (x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8.5e+186: tmp = x elif y <= 9.5e+175: tmp = (y - z) * (x / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8.5e+186) tmp = x; elseif (y <= 9.5e+175) tmp = Float64(Float64(y - z) * Float64(x / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -8.5e+186) tmp = x; elseif (y <= 9.5e+175) tmp = (y - z) * (x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8.5e+186], x, If[LessEqual[y, 9.5e+175], N[(N[(y - z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+186}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+175}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.4999999999999999e186 or 9.5000000000000006e175 < y Initial program 69.4%
associate-*l/57.2%
Simplified57.2%
Taylor expanded in y around inf 83.8%
if -8.4999999999999999e186 < y < 9.5000000000000006e175Initial program 90.6%
associate-*l/92.9%
Simplified92.9%
Final simplification91.0%
(FPCore (x y z) :precision binary64 (if (<= z 2.25e+206) (- x (* z (/ x y))) (/ (* z (- x)) y)))
double code(double x, double y, double z) {
double tmp;
if (z <= 2.25e+206) {
tmp = x - (z * (x / y));
} else {
tmp = (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.25d+206) then
tmp = x - (z * (x / y))
else
tmp = (z * -x) / y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 2.25e+206) {
tmp = x - (z * (x / y));
} else {
tmp = (z * -x) / y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 2.25e+206: tmp = x - (z * (x / y)) else: tmp = (z * -x) / y return tmp
function code(x, y, z) tmp = 0.0 if (z <= 2.25e+206) tmp = Float64(x - Float64(z * Float64(x / y))); else tmp = Float64(Float64(z * Float64(-x)) / y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 2.25e+206) tmp = x - (z * (x / y)); else tmp = (z * -x) / y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 2.25e+206], N[(x - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * (-x)), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.25 \cdot 10^{+206}:\\
\;\;\;\;x - z \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(-x\right)}{y}\\
\end{array}
\end{array}
if z < 2.25000000000000009e206Initial program 84.8%
associate-*l/86.7%
distribute-rgt-out--84.4%
associate-*r/82.2%
associate-*l/94.9%
*-inverses94.9%
*-lft-identity94.9%
Simplified94.9%
if 2.25000000000000009e206 < z Initial program 99.8%
Taylor expanded in y around 0 93.5%
mul-1-neg93.5%
distribute-rgt-neg-out93.5%
Simplified93.5%
Final simplification94.8%
(FPCore (x y z) :precision binary64 (if (<= x -2.4e+79) (* y (/ x y)) x))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.4e+79) {
tmp = y * (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 (x <= (-2.4d+79)) then
tmp = y * (x / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.4e+79) {
tmp = y * (x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.4e+79: tmp = y * (x / y) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.4e+79) tmp = Float64(y * Float64(x / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.4e+79) tmp = y * (x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.4e+79], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+79}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.39999999999999986e79Initial program 83.6%
Taylor expanded in y around inf 27.2%
associate-/l*43.6%
div-inv45.4%
clear-num45.5%
Applied egg-rr45.5%
if -2.39999999999999986e79 < x Initial program 86.9%
associate-*l/82.9%
Simplified82.9%
Taylor expanded in y around inf 47.7%
Final simplification47.3%
(FPCore (x y z) :precision binary64 (- x (* x (/ z y))))
double code(double x, double y, double z) {
return x - (x * (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 - (x * (z / y))
end function
public static double code(double x, double y, double z) {
return x - (x * (z / y));
}
def code(x, y, z): return x - (x * (z / y))
function code(x, y, z) return Float64(x - Float64(x * Float64(z / y))) end
function tmp = code(x, y, z) tmp = x - (x * (z / y)); end
code[x_, y_, z_] := N[(x - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - x \cdot \frac{z}{y}
\end{array}
Initial program 86.2%
associate-*l/85.5%
distribute-rgt-out--82.3%
associate-*r/81.4%
associate-*l/93.2%
*-inverses93.2%
*-lft-identity93.2%
Simplified93.2%
Taylor expanded in z around 0 94.5%
associate-*l/97.2%
Simplified97.2%
Final simplification97.2%
(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 86.2%
associate-*l/85.5%
Simplified85.5%
Taylor expanded in y around inf 45.4%
Final simplification45.4%
(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 2023252
(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))