
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* (- y z) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (x / ((y - z) * (t - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - z) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(if (<= t -4.4e-187)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= t 1.16e-139)
(+ 1.0 (/ (/ x (- z y)) y))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.4e-187) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (t <= 1.16e-139) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.4d-187)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (t <= 1.16d-139) then
tmp = 1.0d0 + ((x / (z - y)) / y)
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.4e-187) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (t <= 1.16e-139) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.4e-187: tmp = 1.0 + ((x / (y - t)) / z) elif t <= 1.16e-139: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.4e-187) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (t <= 1.16e-139) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4.4e-187) tmp = 1.0 + ((x / (y - t)) / z); elseif (t <= 1.16e-139) tmp = 1.0 + ((x / (z - y)) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.4e-187], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e-139], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{-187}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{-139}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -4.40000000000000016e-187Initial program 99.9%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.2%
Simplified75.2%
if -4.40000000000000016e-187 < t < 1.15999999999999999e-139Initial program 98.7%
Taylor expanded in t around 0
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.4%
Simplified93.4%
if 1.15999999999999999e-139 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.9%
Simplified95.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6494.8%
Applied egg-rr94.8%
Final simplification87.2%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.65e-190)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= t 1.2e-139)
(+ 1.0 (/ (/ x y) (- z y)))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.65e-190) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (t <= 1.2e-139) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.65d-190)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (t <= 1.2d-139) then
tmp = 1.0d0 + ((x / y) / (z - y))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.65e-190) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (t <= 1.2e-139) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.65e-190: tmp = 1.0 + ((x / (y - t)) / z) elif t <= 1.2e-139: tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.65e-190) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (t <= 1.2e-139) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.65e-190) tmp = 1.0 + ((x / (y - t)) / z); elseif (t <= 1.2e-139) tmp = 1.0 + ((x / y) / (z - y)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.65e-190], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-139], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{-190}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-139}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -3.64999999999999988e-190Initial program 100.0%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.4%
Simplified75.4%
if -3.64999999999999988e-190 < t < 1.20000000000000007e-139Initial program 98.7%
Taylor expanded in t around 0
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.3%
Simplified93.3%
--lowering--.f64N/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6492.0%
Applied egg-rr92.0%
if 1.20000000000000007e-139 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.9%
Simplified95.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6494.8%
Applied egg-rr94.8%
Final simplification86.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.75e-103)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= z 2.6e-282)
(+ 1.0 (/ x (* y (- t y))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.75e-103) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 2.6e-282) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.75d-103)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= 2.6d-282) then
tmp = 1.0d0 + (x / (y * (t - y)))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.75e-103) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 2.6e-282) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.75e-103: tmp = 1.0 + ((x / (y - t)) / z) elif z <= 2.6e-282: tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.75e-103) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= 2.6e-282) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.75e-103) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= 2.6e-282) tmp = 1.0 + (x / (y * (t - y))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.75e-103], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-282], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-103}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-282}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.75000000000000008e-103Initial program 100.0%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6494.6%
Simplified94.6%
if -1.75000000000000008e-103 < z < 2.60000000000000012e-282Initial program 97.8%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.8%
Simplified88.8%
if 2.60000000000000012e-282 < z Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.9%
Simplified77.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.1%
Applied egg-rr77.1%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1.6e-72) 1.0 (if (<= y 3.2e+99) (+ 1.0 (/ (/ x (- y t)) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-72) {
tmp = 1.0;
} else if (y <= 3.2e+99) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.6d-72)) then
tmp = 1.0d0
else if (y <= 3.2d+99) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-72) {
tmp = 1.0;
} else if (y <= 3.2e+99) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e-72: tmp = 1.0 elif y <= 3.2e+99: tmp = 1.0 + ((x / (y - t)) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e-72) tmp = 1.0; elseif (y <= 3.2e+99) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.6e-72) tmp = 1.0; elseif (y <= 3.2e+99) tmp = 1.0 + ((x / (y - t)) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e-72], 1.0, If[LessEqual[y, 3.2e+99], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-72}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+99}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.6e-72 or 3.19999999999999999e99 < y Initial program 100.0%
Taylor expanded in x around 0
Simplified94.5%
if -1.6e-72 < y < 3.19999999999999999e99Initial program 99.2%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6483.4%
Simplified83.4%
(FPCore (x y z t) :precision binary64 (if (<= y -4.8e-73) 1.0 (if (<= y 6.5e-122) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e-73) {
tmp = 1.0;
} else if (y <= 6.5e-122) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.8d-73)) then
tmp = 1.0d0
else if (y <= 6.5d-122) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e-73) {
tmp = 1.0;
} else if (y <= 6.5e-122) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.8e-73: tmp = 1.0 elif y <= 6.5e-122: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.8e-73) tmp = 1.0; elseif (y <= 6.5e-122) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.8e-73) tmp = 1.0; elseif (y <= 6.5e-122) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.8e-73], 1.0, If[LessEqual[y, 6.5e-122], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-73}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-122}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.80000000000000011e-73 or 6.49999999999999965e-122 < y Initial program 100.0%
Taylor expanded in x around 0
Simplified89.5%
if -4.80000000000000011e-73 < y < 6.49999999999999965e-122Initial program 98.8%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6482.6%
Simplified82.6%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (<= t 8.5e-143) (+ 1.0 (/ (/ x (- y t)) z)) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.5e-143) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 8.5d-143) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.5e-143) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 8.5e-143: tmp = 1.0 + ((x / (y - t)) / z) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 8.5e-143) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 8.5e-143) tmp = 1.0 + ((x / (y - t)) / z); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 8.5e-143], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.5 \cdot 10^{-143}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 8.50000000000000072e-143Initial program 99.4%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6480.5%
Simplified80.5%
if 8.50000000000000072e-143 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.0%
Simplified95.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.9%
Applied egg-rr93.9%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (<= t 6.7e-143) (+ 1.0 (/ (/ x (- y t)) z)) (+ 1.0 (/ (/ x (- y z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6.7e-143) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 6.7d-143) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else
tmp = 1.0d0 + ((x / (y - z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6.7e-143) {
tmp = 1.0 + ((x / (y - t)) / z);
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 6.7e-143: tmp = 1.0 + ((x / (y - t)) / z) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 6.7e-143) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); else tmp = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 6.7e-143) tmp = 1.0 + ((x / (y - t)) / z); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 6.7e-143], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.7 \cdot 10^{-143}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if t < 6.7000000000000004e-143Initial program 99.4%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6480.5%
Simplified80.5%
if 6.7000000000000004e-143 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.0%
Simplified95.0%
(FPCore (x y z t) :precision binary64 (if (<= z -2.05e-249) 1.0 (+ 1.0 (/ (/ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.05e-249) {
tmp = 1.0;
} else {
tmp = 1.0 + ((x / y) / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.05d-249)) then
tmp = 1.0d0
else
tmp = 1.0d0 + ((x / y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.05e-249) {
tmp = 1.0;
} else {
tmp = 1.0 + ((x / y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.05e-249: tmp = 1.0 else: tmp = 1.0 + ((x / y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.05e-249) tmp = 1.0; else tmp = Float64(1.0 + Float64(Float64(x / y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.05e-249) tmp = 1.0; else tmp = 1.0 + ((x / y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.05e-249], 1.0, N[(1.0 + N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-249}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -2.05000000000000002e-249Initial program 100.0%
Taylor expanded in x around 0
Simplified78.8%
if -2.05000000000000002e-249 < z Initial program 99.2%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6476.7%
Simplified76.7%
Taylor expanded in y around inf
/-lowering-/.f6459.7%
Simplified59.7%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.6%
Taylor expanded in x around 0
Simplified78.0%
herbie shell --seed 2024161
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))