
(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 (/ 1.0 (/ (- y z) (/ x (- t y))))))
double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / ((y - z) / (x / (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 + (1.0d0 / ((y - z) / (x / (t - y))))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / ((y - z) / (x / (t - y))));
}
def code(x, y, z, t): return 1.0 + (1.0 / ((y - z) / (x / (t - y))))
function code(x, y, z, t) return Float64(1.0 + Float64(1.0 / Float64(Float64(y - z) / Float64(x / Float64(t - y))))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (1.0 / ((y - z) / (x / (t - y)))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(1.0 / N[(N[(y - z), $MachinePrecision] / N[(x / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{1}{\frac{y - z}{\frac{x}{t - y}}}
\end{array}
Initial program 99.2%
*-commutativeN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.9e-50)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= z 1.8e-143)
(+ 1.0 (/ 1.0 (/ y (/ x (- t y)))))
(+ 1.0 (/ (/ x (- y z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e-50) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 1.8e-143) {
tmp = 1.0 + (1.0 / (y / (x / (t - y))));
} 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 (z <= (-2.9d-50)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= 1.8d-143) then
tmp = 1.0d0 + (1.0d0 / (y / (x / (t - y))))
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 (z <= -2.9e-50) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 1.8e-143) {
tmp = 1.0 + (1.0 / (y / (x / (t - y))));
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.9e-50: tmp = 1.0 + ((x / (y - t)) / z) elif z <= 1.8e-143: tmp = 1.0 + (1.0 / (y / (x / (t - y)))) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e-50) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= 1.8e-143) tmp = Float64(1.0 + Float64(1.0 / Float64(y / Float64(x / Float64(t - y))))); 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 (z <= -2.9e-50) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= 1.8e-143) tmp = 1.0 + (1.0 / (y / (x / (t - y)))); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e-50], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-143], N[(1.0 + N[(1.0 / N[(y / N[(x / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-50}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-143}:\\
\;\;\;\;1 + \frac{1}{\frac{y}{\frac{x}{t - y}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if z < -2.90000000000000008e-50Initial 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--.f6496.4%
Simplified96.4%
if -2.90000000000000008e-50 < z < 1.7999999999999999e-143Initial program 98.7%
*-commutativeN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around inf
Simplified92.1%
if 1.7999999999999999e-143 < z Initial program 99.0%
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--.f6485.7%
Simplified85.7%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (<= z -3.1e-50) (+ 1.0 (/ (/ x (- y t)) z)) (if (<= z 6e-144) (+ 1.0 (/ x (* y (- t y)))) (+ 1.0 (/ (/ x (- y z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e-50) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 6e-144) {
tmp = 1.0 + (x / (y * (t - y)));
} 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 (z <= (-3.1d-50)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= 6d-144) then
tmp = 1.0d0 + (x / (y * (t - y)))
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 (z <= -3.1e-50) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= 6e-144) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.1e-50: tmp = 1.0 + ((x / (y - t)) / z) elif z <= 6e-144: tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.1e-50) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= 6e-144) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); 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 (z <= -3.1e-50) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= 6e-144) tmp = 1.0 + (x / (y * (t - y))); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.1e-50], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-144], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-50}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-144}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if z < -3.1000000000000002e-50Initial 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--.f6496.4%
Simplified96.4%
if -3.1000000000000002e-50 < z < 5.9999999999999997e-144Initial program 98.7%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.1%
Simplified92.1%
if 5.9999999999999997e-144 < z Initial program 99.0%
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--.f6485.7%
Simplified85.7%
Final simplification91.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.3e-162)
(+ 1.0 (/ (/ x (- y t)) z))
(if (<= z -9e-229)
(+ 1.0 (/ -1.0 (/ (* y y) x)))
(+ 1.0 (/ (/ x (- y z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e-162) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= -9e-229) {
tmp = 1.0 + (-1.0 / ((y * y) / x));
} 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 (z <= (-3.3d-162)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= (-9d-229)) then
tmp = 1.0d0 + ((-1.0d0) / ((y * y) / x))
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 (z <= -3.3e-162) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= -9e-229) {
tmp = 1.0 + (-1.0 / ((y * y) / x));
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.3e-162: tmp = 1.0 + ((x / (y - t)) / z) elif z <= -9e-229: tmp = 1.0 + (-1.0 / ((y * y) / x)) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.3e-162) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= -9e-229) tmp = Float64(1.0 + Float64(-1.0 / Float64(Float64(y * y) / x))); 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 (z <= -3.3e-162) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= -9e-229) tmp = 1.0 + (-1.0 / ((y * y) / x)); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.3e-162], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-229], N[(1.0 + N[(-1.0 / N[(N[(y * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-162}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-229}:\\
\;\;\;\;1 + \frac{-1}{\frac{y \cdot y}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if z < -3.30000000000000013e-162Initial 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--.f6489.6%
Simplified89.6%
if -3.30000000000000013e-162 < z < -9.0000000000000004e-229Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6489.3%
Simplified89.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6489.3%
Applied egg-rr89.3%
if -9.0000000000000004e-229 < z Initial program 98.5%
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--.f6481.4%
Simplified81.4%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= z -2e-161) (+ 1.0 (/ (/ x (- y t)) z)) (if (<= z -3.8e-229) (- 1.0 (/ x (* y y))) (+ 1.0 (/ (/ x (- y z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e-161) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= -3.8e-229) {
tmp = 1.0 - (x / (y * y));
} 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 (z <= (-2d-161)) then
tmp = 1.0d0 + ((x / (y - t)) / z)
else if (z <= (-3.8d-229)) then
tmp = 1.0d0 - (x / (y * y))
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 (z <= -2e-161) {
tmp = 1.0 + ((x / (y - t)) / z);
} else if (z <= -3.8e-229) {
tmp = 1.0 - (x / (y * y));
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2e-161: tmp = 1.0 + ((x / (y - t)) / z) elif z <= -3.8e-229: tmp = 1.0 - (x / (y * y)) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2e-161) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)); elseif (z <= -3.8e-229) tmp = Float64(1.0 - Float64(x / Float64(y * y))); 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 (z <= -2e-161) tmp = 1.0 + ((x / (y - t)) / z); elseif (z <= -3.8e-229) tmp = 1.0 - (x / (y * y)); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2e-161], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.8e-229], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-161}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-229}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if z < -2.00000000000000006e-161Initial 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--.f6489.6%
Simplified89.6%
if -2.00000000000000006e-161 < z < -3.8000000000000002e-229Initial program 99.8%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6489.3%
Simplified89.3%
if -3.8000000000000002e-229 < z Initial program 98.5%
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--.f6481.4%
Simplified81.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ 1.0 (/ (/ x (- y t)) z)))) (if (<= z -4.1e-162) t_1 (if (<= z 5.6e-204) (- 1.0 (/ (/ x y) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x / (y - t)) / z);
double tmp;
if (z <= -4.1e-162) {
tmp = t_1;
} else if (z <= 5.6e-204) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + ((x / (y - t)) / z)
if (z <= (-4.1d-162)) then
tmp = t_1
else if (z <= 5.6d-204) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 + ((x / (y - t)) / z);
double tmp;
if (z <= -4.1e-162) {
tmp = t_1;
} else if (z <= 5.6e-204) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + ((x / (y - t)) / z) tmp = 0 if z <= -4.1e-162: tmp = t_1 elif z <= 5.6e-204: tmp = 1.0 - ((x / y) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(Float64(x / Float64(y - t)) / z)) tmp = 0.0 if (z <= -4.1e-162) tmp = t_1; elseif (z <= 5.6e-204) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + ((x / (y - t)) / z); tmp = 0.0; if (z <= -4.1e-162) tmp = t_1; elseif (z <= 5.6e-204) tmp = 1.0 - ((x / y) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e-162], t$95$1, If[LessEqual[z, 5.6e-204], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{\frac{x}{y - t}}{z}\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{-162}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-204}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.10000000000000019e-162 or 5.60000000000000001e-204 < z Initial program 99.5%
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--.f6489.0%
Simplified89.0%
if -4.10000000000000019e-162 < z < 5.60000000000000001e-204Initial program 97.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6476.6%
Simplified76.6%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.6%
Applied egg-rr76.6%
(FPCore (x y z t) :precision binary64 (if (<= y -2.9e-15) 1.0 (if (<= y 6.5e-96) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.9e-15) {
tmp = 1.0;
} else if (y <= 6.5e-96) {
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 <= (-2.9d-15)) then
tmp = 1.0d0
else if (y <= 6.5d-96) 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 <= -2.9e-15) {
tmp = 1.0;
} else if (y <= 6.5e-96) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.9e-15: tmp = 1.0 elif y <= 6.5e-96: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.9e-15) tmp = 1.0; elseif (y <= 6.5e-96) 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 <= -2.9e-15) tmp = 1.0; elseif (y <= 6.5e-96) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.9e-15], 1.0, If[LessEqual[y, 6.5e-96], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-15}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-96}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.90000000000000019e-15 or 6.50000000000000001e-96 < y Initial program 99.9%
Taylor expanded in x around 0
Simplified90.8%
if -2.90000000000000019e-15 < y < 6.50000000000000001e-96Initial program 98.1%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6476.1%
Simplified76.1%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (<= z -2.3e-129) 1.0 (+ 1.0 (/ x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e-129) {
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.3d-129)) 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.3e-129) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.3e-129: tmp = 1.0 else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e-129) tmp = 1.0; else tmp = Float64(1.0 + Float64(x / Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.3e-129) tmp = 1.0; else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.3e-129], 1.0, N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-129}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.3e-129Initial program 99.9%
Taylor expanded in x around 0
Simplified83.5%
if -2.3e-129 < z Initial program 98.7%
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--.f6479.9%
Simplified79.9%
Taylor expanded in y around inf
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6462.9%
Simplified62.9%
Final simplification70.5%
(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.2%
Final simplification99.2%
(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.2%
Taylor expanded in x around 0
Simplified74.2%
herbie shell --seed 2024160
(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)))))