
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x (+ (- y z) 1.0)) z))
double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / 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) + 1.0d0)) / z
end function
public static double code(double x, double y, double z) {
return (x * ((y - z) + 1.0)) / z;
}
def code(x, y, z): return (x * ((y - z) + 1.0)) / z
function code(x, y, z) return Float64(Float64(x * Float64(Float64(y - z) + 1.0)) / z) end
function tmp = code(x, y, z) tmp = (x * ((y - z) + 1.0)) / z; end
code[x_, y_, z_] := N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\left(y - z\right) + 1\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -10.0) (not (<= z 3e-25))) (- (* (/ (+ 1.0 y) z) x) x) (* (/ x z) (+ 1.0 (- y z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -10.0) || !(z <= 3e-25)) {
tmp = (((1.0 + y) / z) * x) - x;
} else {
tmp = (x / z) * (1.0 + (y - 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 <= (-10.0d0)) .or. (.not. (z <= 3d-25))) then
tmp = (((1.0d0 + y) / z) * x) - x
else
tmp = (x / z) * (1.0d0 + (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -10.0) || !(z <= 3e-25)) {
tmp = (((1.0 + y) / z) * x) - x;
} else {
tmp = (x / z) * (1.0 + (y - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -10.0) or not (z <= 3e-25): tmp = (((1.0 + y) / z) * x) - x else: tmp = (x / z) * (1.0 + (y - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -10.0) || !(z <= 3e-25)) tmp = Float64(Float64(Float64(Float64(1.0 + y) / z) * x) - x); else tmp = Float64(Float64(x / z) * Float64(1.0 + Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -10.0) || ~((z <= 3e-25))) tmp = (((1.0 + y) / z) * x) - x; else tmp = (x / z) * (1.0 + (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -10.0], N[Not[LessEqual[z, 3e-25]], $MachinePrecision]], N[(N[(N[(N[(1.0 + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -10 \lor \neg \left(z \leq 3 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{1 + y}{z} \cdot x - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 + \left(y - z\right)\right)\\
\end{array}
\end{array}
if z < -10 or 2.9999999999999998e-25 < z Initial program 77.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 93.8%
neg-mul-193.8%
+-commutative93.8%
unsub-neg93.8%
associate-/l*96.0%
associate-/r/99.9%
Simplified99.9%
if -10 < z < 2.9999999999999998e-25Initial program 99.9%
associate-/l*89.3%
Simplified89.3%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))) (t_1 (* x (/ y z))))
(if (<= z -3.4e+90)
(- x)
(if (<= z -2.05e-17)
t_1
(if (<= z -2.15e-135)
(/ x z)
(if (<= z -2e-200)
t_0
(if (<= z 4.8e-226)
(/ x z)
(if (<= z 1.85e-99)
t_0
(if (<= z 9.8e-74)
(/ x z)
(if (<= z 5.2e-41)
t_0
(if (<= z 1.4e-17)
(/ x z)
(if (<= z 1.08e+92) t_1 (- x)))))))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double t_1 = x * (y / z);
double tmp;
if (z <= -3.4e+90) {
tmp = -x;
} else if (z <= -2.05e-17) {
tmp = t_1;
} else if (z <= -2.15e-135) {
tmp = x / z;
} else if (z <= -2e-200) {
tmp = t_0;
} else if (z <= 4.8e-226) {
tmp = x / z;
} else if (z <= 1.85e-99) {
tmp = t_0;
} else if (z <= 9.8e-74) {
tmp = x / z;
} else if (z <= 5.2e-41) {
tmp = t_0;
} else if (z <= 1.4e-17) {
tmp = x / z;
} else if (z <= 1.08e+92) {
tmp = t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * (x / z)
t_1 = x * (y / z)
if (z <= (-3.4d+90)) then
tmp = -x
else if (z <= (-2.05d-17)) then
tmp = t_1
else if (z <= (-2.15d-135)) then
tmp = x / z
else if (z <= (-2d-200)) then
tmp = t_0
else if (z <= 4.8d-226) then
tmp = x / z
else if (z <= 1.85d-99) then
tmp = t_0
else if (z <= 9.8d-74) then
tmp = x / z
else if (z <= 5.2d-41) then
tmp = t_0
else if (z <= 1.4d-17) then
tmp = x / z
else if (z <= 1.08d+92) then
tmp = t_1
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double t_1 = x * (y / z);
double tmp;
if (z <= -3.4e+90) {
tmp = -x;
} else if (z <= -2.05e-17) {
tmp = t_1;
} else if (z <= -2.15e-135) {
tmp = x / z;
} else if (z <= -2e-200) {
tmp = t_0;
} else if (z <= 4.8e-226) {
tmp = x / z;
} else if (z <= 1.85e-99) {
tmp = t_0;
} else if (z <= 9.8e-74) {
tmp = x / z;
} else if (z <= 5.2e-41) {
tmp = t_0;
} else if (z <= 1.4e-17) {
tmp = x / z;
} else if (z <= 1.08e+92) {
tmp = t_1;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) t_1 = x * (y / z) tmp = 0 if z <= -3.4e+90: tmp = -x elif z <= -2.05e-17: tmp = t_1 elif z <= -2.15e-135: tmp = x / z elif z <= -2e-200: tmp = t_0 elif z <= 4.8e-226: tmp = x / z elif z <= 1.85e-99: tmp = t_0 elif z <= 9.8e-74: tmp = x / z elif z <= 5.2e-41: tmp = t_0 elif z <= 1.4e-17: tmp = x / z elif z <= 1.08e+92: tmp = t_1 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) t_1 = Float64(x * Float64(y / z)) tmp = 0.0 if (z <= -3.4e+90) tmp = Float64(-x); elseif (z <= -2.05e-17) tmp = t_1; elseif (z <= -2.15e-135) tmp = Float64(x / z); elseif (z <= -2e-200) tmp = t_0; elseif (z <= 4.8e-226) tmp = Float64(x / z); elseif (z <= 1.85e-99) tmp = t_0; elseif (z <= 9.8e-74) tmp = Float64(x / z); elseif (z <= 5.2e-41) tmp = t_0; elseif (z <= 1.4e-17) tmp = Float64(x / z); elseif (z <= 1.08e+92) tmp = t_1; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); t_1 = x * (y / z); tmp = 0.0; if (z <= -3.4e+90) tmp = -x; elseif (z <= -2.05e-17) tmp = t_1; elseif (z <= -2.15e-135) tmp = x / z; elseif (z <= -2e-200) tmp = t_0; elseif (z <= 4.8e-226) tmp = x / z; elseif (z <= 1.85e-99) tmp = t_0; elseif (z <= 9.8e-74) tmp = x / z; elseif (z <= 5.2e-41) tmp = t_0; elseif (z <= 1.4e-17) tmp = x / z; elseif (z <= 1.08e+92) tmp = t_1; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+90], (-x), If[LessEqual[z, -2.05e-17], t$95$1, If[LessEqual[z, -2.15e-135], N[(x / z), $MachinePrecision], If[LessEqual[z, -2e-200], t$95$0, If[LessEqual[z, 4.8e-226], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.85e-99], t$95$0, If[LessEqual[z, 9.8e-74], N[(x / z), $MachinePrecision], If[LessEqual[z, 5.2e-41], t$95$0, If[LessEqual[z, 1.4e-17], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.08e+92], t$95$1, (-x)]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+90}:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-135}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-200}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-226}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -3.40000000000000018e90 or 1.08e92 < z Initial program 68.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 83.1%
neg-mul-183.1%
Simplified83.1%
if -3.40000000000000018e90 < z < -2.05e-17 or 1.3999999999999999e-17 < z < 1.08e92Initial program 95.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 59.1%
associate-/l*58.8%
associate-/r/61.3%
Simplified61.3%
if -2.05e-17 < z < -2.14999999999999999e-135 or -2e-200 < z < 4.7999999999999999e-226 or 1.85e-99 < z < 9.8000000000000006e-74 or 5.1999999999999999e-41 < z < 1.3999999999999999e-17Initial program 99.9%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around 0 99.9%
associate-/l*99.7%
associate-/r/92.6%
Simplified92.6%
Taylor expanded in y around 0 71.3%
if -2.14999999999999999e-135 < z < -2e-200 or 4.7999999999999999e-226 < z < 1.85e-99 or 9.8000000000000006e-74 < z < 5.1999999999999999e-41Initial program 99.8%
associate-/l*83.0%
Simplified83.0%
Taylor expanded in y around inf 81.2%
associate-/l*81.2%
Simplified81.2%
clear-num81.0%
associate-/r/81.1%
clear-num81.3%
Applied egg-rr81.3%
Final simplification75.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -1.35)
(- x)
(if (<= z -1.7e-136)
(/ x z)
(if (<= z -1.8e-200)
t_0
(if (<= z 5.5e-226)
(/ x z)
(if (<= z 2.1e-99)
t_0
(if (<= z 5.2e-76)
(/ x z)
(if (<= z 3.2e-41)
t_0
(if (<= z 2.3e-17)
(/ x z)
(if (<= z 1.08e+92) t_0 (- x))))))))))))
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.35) {
tmp = -x;
} else if (z <= -1.7e-136) {
tmp = x / z;
} else if (z <= -1.8e-200) {
tmp = t_0;
} else if (z <= 5.5e-226) {
tmp = x / z;
} else if (z <= 2.1e-99) {
tmp = t_0;
} else if (z <= 5.2e-76) {
tmp = x / z;
} else if (z <= 3.2e-41) {
tmp = t_0;
} else if (z <= 2.3e-17) {
tmp = x / z;
} else if (z <= 1.08e+92) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-1.35d0)) then
tmp = -x
else if (z <= (-1.7d-136)) then
tmp = x / z
else if (z <= (-1.8d-200)) then
tmp = t_0
else if (z <= 5.5d-226) then
tmp = x / z
else if (z <= 2.1d-99) then
tmp = t_0
else if (z <= 5.2d-76) then
tmp = x / z
else if (z <= 3.2d-41) then
tmp = t_0
else if (z <= 2.3d-17) then
tmp = x / z
else if (z <= 1.08d+92) then
tmp = t_0
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.35) {
tmp = -x;
} else if (z <= -1.7e-136) {
tmp = x / z;
} else if (z <= -1.8e-200) {
tmp = t_0;
} else if (z <= 5.5e-226) {
tmp = x / z;
} else if (z <= 2.1e-99) {
tmp = t_0;
} else if (z <= 5.2e-76) {
tmp = x / z;
} else if (z <= 3.2e-41) {
tmp = t_0;
} else if (z <= 2.3e-17) {
tmp = x / z;
} else if (z <= 1.08e+92) {
tmp = t_0;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -1.35: tmp = -x elif z <= -1.7e-136: tmp = x / z elif z <= -1.8e-200: tmp = t_0 elif z <= 5.5e-226: tmp = x / z elif z <= 2.1e-99: tmp = t_0 elif z <= 5.2e-76: tmp = x / z elif z <= 3.2e-41: tmp = t_0 elif z <= 2.3e-17: tmp = x / z elif z <= 1.08e+92: tmp = t_0 else: tmp = -x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -1.35) tmp = Float64(-x); elseif (z <= -1.7e-136) tmp = Float64(x / z); elseif (z <= -1.8e-200) tmp = t_0; elseif (z <= 5.5e-226) tmp = Float64(x / z); elseif (z <= 2.1e-99) tmp = t_0; elseif (z <= 5.2e-76) tmp = Float64(x / z); elseif (z <= 3.2e-41) tmp = t_0; elseif (z <= 2.3e-17) tmp = Float64(x / z); elseif (z <= 1.08e+92) tmp = t_0; else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x / z); tmp = 0.0; if (z <= -1.35) tmp = -x; elseif (z <= -1.7e-136) tmp = x / z; elseif (z <= -1.8e-200) tmp = t_0; elseif (z <= 5.5e-226) tmp = x / z; elseif (z <= 2.1e-99) tmp = t_0; elseif (z <= 5.2e-76) tmp = x / z; elseif (z <= 3.2e-41) tmp = t_0; elseif (z <= 2.3e-17) tmp = x / z; elseif (z <= 1.08e+92) tmp = t_0; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35], (-x), If[LessEqual[z, -1.7e-136], N[(x / z), $MachinePrecision], If[LessEqual[z, -1.8e-200], t$95$0, If[LessEqual[z, 5.5e-226], N[(x / z), $MachinePrecision], If[LessEqual[z, 2.1e-99], t$95$0, If[LessEqual[z, 5.2e-76], N[(x / z), $MachinePrecision], If[LessEqual[z, 3.2e-41], t$95$0, If[LessEqual[z, 2.3e-17], N[(x / z), $MachinePrecision], If[LessEqual[z, 1.08e+92], t$95$0, (-x)]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -1.35:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-200}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-226}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{+92}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1.3500000000000001 or 1.08e92 < z Initial program 72.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 76.7%
neg-mul-176.7%
Simplified76.7%
if -1.3500000000000001 < z < -1.7e-136 or -1.8000000000000001e-200 < z < 5.5e-226 or 2.09999999999999984e-99 < z < 5.1999999999999999e-76 or 3.20000000000000012e-41 < z < 2.30000000000000009e-17Initial program 99.9%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around 0 99.9%
associate-/l*99.7%
associate-/r/92.7%
Simplified92.7%
Taylor expanded in y around 0 69.6%
if -1.7e-136 < z < -1.8000000000000001e-200 or 5.5e-226 < z < 2.09999999999999984e-99 or 5.1999999999999999e-76 < z < 3.20000000000000012e-41 or 2.30000000000000009e-17 < z < 1.08e92Initial program 98.4%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in y around inf 73.5%
associate-/l*74.8%
Simplified74.8%
clear-num74.6%
associate-/r/74.7%
clear-num74.9%
Applied egg-rr74.9%
Final simplification74.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* x (/ y z)) x)))
(if (<= y -1.0)
t_0
(if (<= y 0.15)
(- (/ x z) x)
(if (<= y 4.5e+212) t_0 (* (* y x) (/ 1.0 z)))))))
double code(double x, double y, double z) {
double t_0 = (x * (y / z)) - x;
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 0.15) {
tmp = (x / z) - x;
} else if (y <= 4.5e+212) {
tmp = t_0;
} else {
tmp = (y * x) * (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = (x * (y / z)) - x
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 0.15d0) then
tmp = (x / z) - x
else if (y <= 4.5d+212) then
tmp = t_0
else
tmp = (y * x) * (1.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x * (y / z)) - x;
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 0.15) {
tmp = (x / z) - x;
} else if (y <= 4.5e+212) {
tmp = t_0;
} else {
tmp = (y * x) * (1.0 / z);
}
return tmp;
}
def code(x, y, z): t_0 = (x * (y / z)) - x tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 0.15: tmp = (x / z) - x elif y <= 4.5e+212: tmp = t_0 else: tmp = (y * x) * (1.0 / z) return tmp
function code(x, y, z) t_0 = Float64(Float64(x * Float64(y / z)) - x) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 0.15) tmp = Float64(Float64(x / z) - x); elseif (y <= 4.5e+212) tmp = t_0; else tmp = Float64(Float64(y * x) * Float64(1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x * (y / z)) - x; tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 0.15) tmp = (x / z) - x; elseif (y <= 4.5e+212) tmp = t_0; else tmp = (y * x) * (1.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 0.15], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 4.5e+212], t$95$0, N[(N[(y * x), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{y}{z} - x\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 0.15:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+212}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\end{array}
\end{array}
if y < -1 or 0.149999999999999994 < y < 4.5000000000000002e212Initial program 88.9%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in z around 0 92.2%
neg-mul-192.2%
+-commutative92.2%
unsub-neg92.2%
associate-/l*95.9%
associate-/r/92.3%
Simplified92.3%
Taylor expanded in y around inf 90.5%
associate-*l/90.6%
*-commutative90.6%
Simplified90.6%
if -1 < y < 0.149999999999999994Initial program 84.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 97.9%
if 4.5000000000000002e212 < y Initial program 99.7%
associate-/l*65.8%
Simplified65.8%
Taylor expanded in y around inf 99.7%
associate-/l*95.1%
Simplified95.1%
div-inv94.8%
clear-num95.0%
div-inv94.9%
associate-*r*99.8%
Applied egg-rr99.8%
Final simplification94.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (/ x (/ z y)) x)))
(if (<= y -1.0)
t_0
(if (<= y 0.15)
(- (/ x z) x)
(if (<= y 9.5e+210) t_0 (* (* y x) (/ 1.0 z)))))))
double code(double x, double y, double z) {
double t_0 = (x / (z / y)) - x;
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 0.15) {
tmp = (x / z) - x;
} else if (y <= 9.5e+210) {
tmp = t_0;
} else {
tmp = (y * x) * (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = (x / (z / y)) - x
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 0.15d0) then
tmp = (x / z) - x
else if (y <= 9.5d+210) then
tmp = t_0
else
tmp = (y * x) * (1.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x / (z / y)) - x;
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 0.15) {
tmp = (x / z) - x;
} else if (y <= 9.5e+210) {
tmp = t_0;
} else {
tmp = (y * x) * (1.0 / z);
}
return tmp;
}
def code(x, y, z): t_0 = (x / (z / y)) - x tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 0.15: tmp = (x / z) - x elif y <= 9.5e+210: tmp = t_0 else: tmp = (y * x) * (1.0 / z) return tmp
function code(x, y, z) t_0 = Float64(Float64(x / Float64(z / y)) - x) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 0.15) tmp = Float64(Float64(x / z) - x); elseif (y <= 9.5e+210) tmp = t_0; else tmp = Float64(Float64(y * x) * Float64(1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x / (z / y)) - x; tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 0.15) tmp = (x / z) - x; elseif (y <= 9.5e+210) tmp = t_0; else tmp = (y * x) * (1.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 0.15], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 9.5e+210], t$95$0, N[(N[(y * x), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\frac{z}{y}} - x\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 0.15:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+210}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\end{array}
\end{array}
if y < -1 or 0.149999999999999994 < y < 9.5000000000000004e210Initial program 88.9%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in z around 0 92.2%
neg-mul-192.2%
+-commutative92.2%
unsub-neg92.2%
associate-/l*95.9%
associate-/r/92.3%
Simplified92.3%
*-commutative92.3%
clear-num92.2%
un-div-inv94.7%
Applied egg-rr94.7%
Taylor expanded in y around inf 93.0%
if -1 < y < 0.149999999999999994Initial program 84.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 97.9%
if 9.5000000000000004e210 < y Initial program 99.7%
associate-/l*65.8%
Simplified65.8%
Taylor expanded in y around inf 99.7%
associate-/l*95.1%
Simplified95.1%
div-inv94.8%
clear-num95.0%
div-inv94.9%
associate-*r*99.8%
Applied egg-rr99.8%
Final simplification95.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.4e+22) (not (<= z 6.5e+61))) (- (* x (/ y z)) x) (* (/ x z) (+ 1.0 (- y z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.4e+22) || !(z <= 6.5e+61)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x / z) * (1.0 + (y - 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 <= (-1.4d+22)) .or. (.not. (z <= 6.5d+61))) then
tmp = (x * (y / z)) - x
else
tmp = (x / z) * (1.0d0 + (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.4e+22) || !(z <= 6.5e+61)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x / z) * (1.0 + (y - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.4e+22) or not (z <= 6.5e+61): tmp = (x * (y / z)) - x else: tmp = (x / z) * (1.0 + (y - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.4e+22) || !(z <= 6.5e+61)) tmp = Float64(Float64(x * Float64(y / z)) - x); else tmp = Float64(Float64(x / z) * Float64(1.0 + Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.4e+22) || ~((z <= 6.5e+61))) tmp = (x * (y / z)) - x; else tmp = (x / z) * (1.0 + (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.4e+22], N[Not[LessEqual[z, 6.5e+61]], $MachinePrecision]], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(1.0 + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+22} \lor \neg \left(z \leq 6.5 \cdot 10^{+61}\right):\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(1 + \left(y - z\right)\right)\\
\end{array}
\end{array}
if z < -1.4e22 or 6.4999999999999996e61 < z Initial program 73.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 93.3%
neg-mul-193.3%
+-commutative93.3%
unsub-neg93.3%
associate-/l*95.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around inf 93.3%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
if -1.4e22 < z < 6.4999999999999996e61Initial program 99.2%
associate-/l*91.1%
Simplified91.1%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -13.2) (not (<= z 1.0))) (- (* x (/ y z)) x) (/ (+ x (* y x)) z)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -13.2) || !(z <= 1.0)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x + (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 ((z <= (-13.2d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x * (y / z)) - x
else
tmp = (x + (y * x)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -13.2) || !(z <= 1.0)) {
tmp = (x * (y / z)) - x;
} else {
tmp = (x + (y * x)) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -13.2) or not (z <= 1.0): tmp = (x * (y / z)) - x else: tmp = (x + (y * x)) / z return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -13.2) || !(z <= 1.0)) tmp = Float64(Float64(x * Float64(y / z)) - x); else tmp = Float64(Float64(x + Float64(y * x)) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -13.2) || ~((z <= 1.0))) tmp = (x * (y / z)) - x; else tmp = (x + (y * x)) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -13.2], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(x + N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13.2 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot x}{z}\\
\end{array}
\end{array}
if z < -13.199999999999999 or 1 < z Initial program 75.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 93.1%
neg-mul-193.1%
+-commutative93.1%
unsub-neg93.1%
associate-/l*95.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around inf 92.2%
associate-*l/99.0%
*-commutative99.0%
Simplified99.0%
if -13.199999999999999 < z < 1Initial program 99.8%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in z around 0 99.5%
*-commutative99.5%
distribute-lft-in99.5%
*-rgt-identity99.5%
Simplified99.5%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (<= y -900.0) (* y (/ x z)) (if (<= y 1e+61) (- (/ x z) x) (* (* y x) (/ 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -900.0) {
tmp = y * (x / z);
} else if (y <= 1e+61) {
tmp = (x / z) - x;
} else {
tmp = (y * x) * (1.0 / 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 <= (-900.0d0)) then
tmp = y * (x / z)
else if (y <= 1d+61) then
tmp = (x / z) - x
else
tmp = (y * x) * (1.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -900.0) {
tmp = y * (x / z);
} else if (y <= 1e+61) {
tmp = (x / z) - x;
} else {
tmp = (y * x) * (1.0 / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -900.0: tmp = y * (x / z) elif y <= 1e+61: tmp = (x / z) - x else: tmp = (y * x) * (1.0 / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -900.0) tmp = Float64(y * Float64(x / z)); elseif (y <= 1e+61) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(y * x) * Float64(1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -900.0) tmp = y * (x / z); elseif (y <= 1e+61) tmp = (x / z) - x; else tmp = (y * x) * (1.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -900.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+61], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -900:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 10^{+61}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\end{array}
\end{array}
if y < -900Initial program 82.8%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in y around inf 64.9%
associate-/l*66.5%
Simplified66.5%
clear-num66.4%
associate-/r/66.5%
clear-num67.0%
Applied egg-rr67.0%
if -900 < y < 9.99999999999999949e60Initial program 85.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 95.4%
if 9.99999999999999949e60 < y Initial program 98.0%
associate-/l*84.1%
Simplified84.1%
Taylor expanded in y around inf 87.5%
associate-/l*84.6%
Simplified84.6%
div-inv84.5%
clear-num84.6%
div-inv84.4%
associate-*r*87.5%
Applied egg-rr87.5%
Final simplification86.3%
(FPCore (x y z) :precision binary64 (if (<= y -3.6e-8) (* (/ (+ 1.0 y) z) x) (if (<= y 2.6e+63) (- (/ x z) x) (* (* y x) (/ 1.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.6e-8) {
tmp = ((1.0 + y) / z) * x;
} else if (y <= 2.6e+63) {
tmp = (x / z) - x;
} else {
tmp = (y * x) * (1.0 / 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 <= (-3.6d-8)) then
tmp = ((1.0d0 + y) / z) * x
else if (y <= 2.6d+63) then
tmp = (x / z) - x
else
tmp = (y * x) * (1.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.6e-8) {
tmp = ((1.0 + y) / z) * x;
} else if (y <= 2.6e+63) {
tmp = (x / z) - x;
} else {
tmp = (y * x) * (1.0 / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.6e-8: tmp = ((1.0 + y) / z) * x elif y <= 2.6e+63: tmp = (x / z) - x else: tmp = (y * x) * (1.0 / z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.6e-8) tmp = Float64(Float64(Float64(1.0 + y) / z) * x); elseif (y <= 2.6e+63) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(y * x) * Float64(1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.6e-8) tmp = ((1.0 + y) / z) * x; elseif (y <= 2.6e+63) tmp = (x / z) - x; else tmp = (y * x) * (1.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.6e-8], N[(N[(N[(1.0 + y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 2.6e+63], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{1 + y}{z} \cdot x\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+63}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\end{array}
\end{array}
if y < -3.59999999999999981e-8Initial program 84.0%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around 0 68.7%
associate-/l*70.1%
associate-/r/67.4%
Simplified67.4%
if -3.59999999999999981e-8 < y < 2.6000000000000001e63Initial program 85.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 97.2%
if 2.6000000000000001e63 < y Initial program 98.0%
associate-/l*84.1%
Simplified84.1%
Taylor expanded in y around inf 87.5%
associate-/l*84.6%
Simplified84.6%
div-inv84.5%
clear-num84.6%
div-inv84.4%
associate-*r*87.5%
Applied egg-rr87.5%
Final simplification86.8%
(FPCore (x y z) :precision binary64 (if (<= y -1.0) (- (/ x (/ z y)) x) (if (<= y 0.15) (- (/ x z) x) (- (/ (* y x) z) x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = (x / (z / y)) - x;
} else if (y <= 0.15) {
tmp = (x / z) - x;
} else {
tmp = ((y * x) / z) - 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 <= (-1.0d0)) then
tmp = (x / (z / y)) - x
else if (y <= 0.15d0) then
tmp = (x / z) - x
else
tmp = ((y * x) / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.0) {
tmp = (x / (z / y)) - x;
} else if (y <= 0.15) {
tmp = (x / z) - x;
} else {
tmp = ((y * x) / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.0: tmp = (x / (z / y)) - x elif y <= 0.15: tmp = (x / z) - x else: tmp = ((y * x) / z) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.0) tmp = Float64(Float64(x / Float64(z / y)) - x); elseif (y <= 0.15) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(Float64(y * x) / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.0) tmp = (x / (z / y)) - x; elseif (y <= 0.15) tmp = (x / z) - x; else tmp = ((y * x) / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.0], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 0.15], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;\frac{x}{\frac{z}{y}} - x\\
\mathbf{elif}\;y \leq 0.15:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z} - x\\
\end{array}
\end{array}
if y < -1Initial program 82.8%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in z around 0 88.4%
neg-mul-188.4%
+-commutative88.4%
unsub-neg88.4%
associate-/l*94.5%
associate-/r/92.8%
Simplified92.8%
*-commutative92.8%
clear-num92.7%
un-div-inv94.2%
Applied egg-rr94.2%
Taylor expanded in y around inf 92.7%
if -1 < y < 0.149999999999999994Initial program 84.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 97.9%
if 0.149999999999999994 < y Initial program 98.2%
associate-/l*86.5%
Simplified86.5%
Taylor expanded in z around 0 98.3%
neg-mul-198.3%
+-commutative98.3%
unsub-neg98.3%
associate-/l*97.1%
associate-/r/82.8%
Simplified82.8%
Taylor expanded in y around inf 96.8%
Final simplification96.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -1500.0) (not (<= y 8.3e+65))) (* y (/ x z)) (- (/ x z) x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1500.0) || !(y <= 8.3e+65)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - 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 <= (-1500.0d0)) .or. (.not. (y <= 8.3d+65))) then
tmp = y * (x / z)
else
tmp = (x / z) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1500.0) || !(y <= 8.3e+65)) {
tmp = y * (x / z);
} else {
tmp = (x / z) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1500.0) or not (y <= 8.3e+65): tmp = y * (x / z) else: tmp = (x / z) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1500.0) || !(y <= 8.3e+65)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(Float64(x / z) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1500.0) || ~((y <= 8.3e+65))) tmp = y * (x / z); else tmp = (x / z) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1500.0], N[Not[LessEqual[y, 8.3e+65]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1500 \lor \neg \left(y \leq 8.3 \cdot 10^{+65}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} - x\\
\end{array}
\end{array}
if y < -1500 or 8.3000000000000004e65 < y Initial program 89.8%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in y around inf 75.3%
associate-/l*74.8%
Simplified74.8%
clear-num74.7%
associate-/r/74.8%
clear-num75.1%
Applied egg-rr75.1%
if -1500 < y < 8.3000000000000004e65Initial program 85.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 95.4%
Final simplification85.7%
(FPCore (x y z) :precision binary64 (if (<= y -1500.0) (* y (/ x z)) (if (<= y 1.92e+59) (- (/ x z) x) (/ y (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1500.0) {
tmp = y * (x / z);
} else if (y <= 1.92e+59) {
tmp = (x / z) - x;
} else {
tmp = y / (z / 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 <= (-1500.0d0)) then
tmp = y * (x / z)
else if (y <= 1.92d+59) then
tmp = (x / z) - x
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1500.0) {
tmp = y * (x / z);
} else if (y <= 1.92e+59) {
tmp = (x / z) - x;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1500.0: tmp = y * (x / z) elif y <= 1.92e+59: tmp = (x / z) - x else: tmp = y / (z / x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1500.0) tmp = Float64(y * Float64(x / z)); elseif (y <= 1.92e+59) tmp = Float64(Float64(x / z) - x); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1500.0) tmp = y * (x / z); elseif (y <= 1.92e+59) tmp = (x / z) - x; else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1500.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.92e+59], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1500:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.92 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -1500Initial program 82.8%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in y around inf 64.9%
associate-/l*66.5%
Simplified66.5%
clear-num66.4%
associate-/r/66.5%
clear-num67.0%
Applied egg-rr67.0%
if -1500 < y < 1.92e59Initial program 85.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 95.4%
if 1.92e59 < y Initial program 98.0%
associate-/l*84.1%
Simplified84.1%
Taylor expanded in y around inf 87.5%
associate-/l*84.6%
Simplified84.6%
Final simplification85.7%
(FPCore (x y z) :precision binary64 (if (<= y -1500.0) (* y (/ x z)) (if (<= y 3.8e+57) (- (/ x z) x) (/ (* y x) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1500.0) {
tmp = y * (x / z);
} else if (y <= 3.8e+57) {
tmp = (x / z) - x;
} 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 <= (-1500.0d0)) then
tmp = y * (x / z)
else if (y <= 3.8d+57) then
tmp = (x / z) - x
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 <= -1500.0) {
tmp = y * (x / z);
} else if (y <= 3.8e+57) {
tmp = (x / z) - x;
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1500.0: tmp = y * (x / z) elif y <= 3.8e+57: tmp = (x / z) - x else: tmp = (y * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1500.0) tmp = Float64(y * Float64(x / z)); elseif (y <= 3.8e+57) tmp = Float64(Float64(x / z) - x); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1500.0) tmp = y * (x / z); elseif (y <= 3.8e+57) tmp = (x / z) - x; else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1500.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+57], N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1500:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+57}:\\
\;\;\;\;\frac{x}{z} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -1500Initial program 82.8%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in y around inf 64.9%
associate-/l*66.5%
Simplified66.5%
clear-num66.4%
associate-/r/66.5%
clear-num67.0%
Applied egg-rr67.0%
if -1500 < y < 3.7999999999999999e57Initial program 85.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
neg-mul-1100.0%
+-commutative100.0%
unsub-neg100.0%
associate-/l*99.8%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 95.4%
if 3.7999999999999999e57 < y Initial program 98.0%
associate-/l*84.1%
Simplified84.1%
Taylor expanded in y around inf 87.5%
Final simplification86.3%
(FPCore (x y z) :precision binary64 (if (<= z -1.35) (- x) (if (<= z 1.0) (/ x z) (- x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.35) {
tmp = -x;
} else if (z <= 1.0) {
tmp = x / z;
} 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.35d0)) then
tmp = -x
else if (z <= 1.0d0) then
tmp = x / z
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.35) {
tmp = -x;
} else if (z <= 1.0) {
tmp = x / z;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.35: tmp = -x elif z <= 1.0: tmp = x / z else: tmp = -x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.35) tmp = Float64(-x); elseif (z <= 1.0) tmp = Float64(x / z); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.35) tmp = -x; elseif (z <= 1.0) tmp = x / z; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.35], (-x), If[LessEqual[z, 1.0], N[(x / z), $MachinePrecision], (-x)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35:\\
\;\;\;\;-x\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
if z < -1.3500000000000001 or 1 < z Initial program 75.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 72.1%
neg-mul-172.1%
Simplified72.1%
if -1.3500000000000001 < z < 1Initial program 99.8%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in z around 0 99.5%
associate-/l*99.3%
associate-/r/87.2%
Simplified87.2%
Taylor expanded in y around 0 53.2%
Final simplification62.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 Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 87.7%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 37.1%
neg-mul-137.1%
Simplified37.1%
Final simplification37.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* (+ 1.0 y) (/ x z)) x)))
(if (< x -2.71483106713436e-162)
t_0
(if (< x 3.874108816439546e-197)
(* (* x (+ (- y z) 1.0)) (/ 1.0 z))
t_0))))
double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
} 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 = ((1.0d0 + y) * (x / z)) - x
if (x < (-2.71483106713436d-162)) then
tmp = t_0
else if (x < 3.874108816439546d-197) then
tmp = (x * ((y - z) + 1.0d0)) * (1.0d0 / z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((1.0 + y) * (x / z)) - x;
double tmp;
if (x < -2.71483106713436e-162) {
tmp = t_0;
} else if (x < 3.874108816439546e-197) {
tmp = (x * ((y - z) + 1.0)) * (1.0 / z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((1.0 + y) * (x / z)) - x tmp = 0 if x < -2.71483106713436e-162: tmp = t_0 elif x < 3.874108816439546e-197: tmp = (x * ((y - z) + 1.0)) * (1.0 / z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(1.0 + y) * Float64(x / z)) - x) tmp = 0.0 if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = Float64(Float64(x * Float64(Float64(y - z) + 1.0)) * Float64(1.0 / z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((1.0 + y) * (x / z)) - x; tmp = 0.0; if (x < -2.71483106713436e-162) tmp = t_0; elseif (x < 3.874108816439546e-197) tmp = (x * ((y - z) + 1.0)) * (1.0 / z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 + y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]}, If[Less[x, -2.71483106713436e-162], t$95$0, If[Less[x, 3.874108816439546e-197], N[(N[(x * N[(N[(y - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + y\right) \cdot \frac{x}{z} - x\\
\mathbf{if}\;x < -2.71483106713436 \cdot 10^{-162}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x < 3.874108816439546 \cdot 10^{-197}:\\
\;\;\;\;\left(x \cdot \left(\left(y - z\right) + 1\right)\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023213
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< x -2.71483106713436e-162) (- (* (+ 1.0 y) (/ x z)) x) (if (< x 3.874108816439546e-197) (* (* x (+ (- y z) 1.0)) (/ 1.0 z)) (- (* (+ 1.0 y) (/ x z)) x)))
(/ (* x (+ (- y z) 1.0)) z))