
(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 11 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.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.25e-34)
(- 1.0 (/ (/ x y) y))
(if (<= y 1.1e-197)
(+ 1.0 (/ x (* z (- y t))))
(if (<= y 620000000000.0) (+ 1.0 (/ (/ x (- y z)) t)) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e-34) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 1.1e-197) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (y <= 620000000000.0) {
tmp = 1.0 + ((x / (y - 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 <= (-1.25d-34)) then
tmp = 1.0d0 - ((x / y) / y)
else if (y <= 1.1d-197) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (y <= 620000000000.0d0) then
tmp = 1.0d0 + ((x / (y - 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 <= -1.25e-34) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 1.1e-197) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (y <= 620000000000.0) {
tmp = 1.0 + ((x / (y - z)) / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e-34: tmp = 1.0 - ((x / y) / y) elif y <= 1.1e-197: tmp = 1.0 + (x / (z * (y - t))) elif y <= 620000000000.0: tmp = 1.0 + ((x / (y - z)) / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e-34) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (y <= 1.1e-197) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (y <= 620000000000.0) tmp = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.25e-34) tmp = 1.0 - ((x / y) / y); elseif (y <= 1.1e-197) tmp = 1.0 + (x / (z * (y - t))); elseif (y <= 620000000000.0) tmp = 1.0 + ((x / (y - z)) / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e-34], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-197], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 620000000000.0], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-34}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-197}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;y \leq 620000000000:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.2500000000000001e-34Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6493.7%
Simplified93.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6493.8%
Applied egg-rr93.8%
if -1.2500000000000001e-34 < y < 1.1e-197Initial program 99.9%
--lowering--.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.1%
Applied egg-rr94.1%
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
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6486.5%
Simplified86.5%
if 1.1e-197 < y < 6.2e11Initial program 99.8%
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--.f6471.0%
Simplified71.0%
if 6.2e11 < y Initial program 100.0%
Taylor expanded in x around 0
Simplified98.0%
Final simplification88.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.25e-95)
(+ 1.0 (/ x (* y (- z y))))
(if (<= y 1.16e-46)
(+ 1.0 (/ x (* (- y z) t)))
(+ 1.0 (/ x (* y (- t y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.25e-95) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (y <= 1.16e-46) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
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.25d-95)) then
tmp = 1.0d0 + (x / (y * (z - y)))
else if (y <= 1.16d-46) then
tmp = 1.0d0 + (x / ((y - z) * t))
else
tmp = 1.0d0 + (x / (y * (t - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.25e-95) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (y <= 1.16e-46) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.25e-95: tmp = 1.0 + (x / (y * (z - y))) elif y <= 1.16e-46: tmp = 1.0 + (x / ((y - z) * t)) else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.25e-95) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); elseif (y <= 1.16e-46) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); else tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.25e-95) tmp = 1.0 + (x / (y * (z - y))); elseif (y <= 1.16e-46) tmp = 1.0 + (x / ((y - z) * t)); else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.25e-95], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e-46], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{-95}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-46}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if y < -2.25e-95Initial program 99.9%
Taylor expanded in y around inf
Simplified93.0%
if -2.25e-95 < y < 1.16e-46Initial 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--.f6480.6%
Simplified80.6%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6486.1%
Applied egg-rr86.1%
if 1.16e-46 < y Initial program 99.9%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6496.3%
Simplified96.3%
Final simplification91.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.2e-77)
(+ 1.0 (/ x (* z (- y t))))
(if (<= z 1.7e-190)
(+ 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 <= -4.2e-77) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= 1.7e-190) {
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 <= (-4.2d-77)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (z <= 1.7d-190) 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 <= -4.2e-77) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= 1.7e-190) {
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 <= -4.2e-77: tmp = 1.0 + (x / (z * (y - t))) elif z <= 1.7e-190: 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 <= -4.2e-77) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (z <= 1.7e-190) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.2e-77) tmp = 1.0 + (x / (z * (y - t))); elseif (z <= 1.7e-190) 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, -4.2e-77], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-190], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-77}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-190}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -4.20000000000000031e-77Initial program 99.9%
--lowering--.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.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
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6495.4%
Simplified95.4%
if -4.20000000000000031e-77 < z < 1.69999999999999991e-190Initial program 99.9%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6489.4%
Simplified89.4%
if 1.69999999999999991e-190 < 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--.f6478.0%
Simplified78.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6479.9%
Applied egg-rr79.9%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.25e-34) (- 1.0 (/ (/ x y) y)) (if (<= y 4.5e-53) (+ 1.0 (/ x (* z (- y t)))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e-34) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 4.5e-53) {
tmp = 1.0 + (x / (z * (y - 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 <= (-1.25d-34)) then
tmp = 1.0d0 - ((x / y) / y)
else if (y <= 4.5d-53) then
tmp = 1.0d0 + (x / (z * (y - 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 <= -1.25e-34) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 4.5e-53) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e-34: tmp = 1.0 - ((x / y) / y) elif y <= 4.5e-53: tmp = 1.0 + (x / (z * (y - t))) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e-34) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (y <= 4.5e-53) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.25e-34) tmp = 1.0 - ((x / y) / y); elseif (y <= 4.5e-53) tmp = 1.0 + (x / (z * (y - t))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e-34], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-53], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-34}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-53}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.2500000000000001e-34Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6493.7%
Simplified93.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6493.8%
Applied egg-rr93.8%
if -1.2500000000000001e-34 < y < 4.49999999999999985e-53Initial program 99.9%
--lowering--.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.9%
Applied egg-rr94.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
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6487.7%
Simplified87.7%
if 4.49999999999999985e-53 < y Initial program 99.9%
Taylor expanded in x around 0
Simplified91.6%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (<= y -5.5e-120) (- 1.0 (/ (/ x y) y)) (if (<= y 1.9e-99) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e-120) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 1.9e-99) {
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 <= (-5.5d-120)) then
tmp = 1.0d0 - ((x / y) / y)
else if (y <= 1.9d-99) 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 <= -5.5e-120) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 1.9e-99) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e-120: tmp = 1.0 - ((x / y) / y) elif y <= 1.9e-99: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e-120) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (y <= 1.9e-99) 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 <= -5.5e-120) tmp = 1.0 - ((x / y) / y); elseif (y <= 1.9e-99) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e-120], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-99], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-120}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-99}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.5000000000000001e-120Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6485.1%
Simplified85.1%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6485.1%
Applied egg-rr85.1%
if -5.5000000000000001e-120 < y < 1.8999999999999998e-99Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6485.8%
Simplified85.8%
if 1.8999999999999998e-99 < y Initial program 99.9%
Taylor expanded in x around 0
Simplified89.1%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (<= y -5.5e-120) (- 1.0 (/ x (* y y))) (if (<= y 2.5e-99) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e-120) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 2.5e-99) {
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 <= (-5.5d-120)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 2.5d-99) 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 <= -5.5e-120) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 2.5e-99) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e-120: tmp = 1.0 - (x / (y * y)) elif y <= 2.5e-99: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e-120) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 2.5e-99) 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 <= -5.5e-120) tmp = 1.0 - (x / (y * y)); elseif (y <= 2.5e-99) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e-120], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-99], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-120}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-99}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.5000000000000001e-120Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6485.1%
Simplified85.1%
if -5.5000000000000001e-120 < y < 2.49999999999999985e-99Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6485.8%
Simplified85.8%
if 2.49999999999999985e-99 < y Initial program 99.9%
Taylor expanded in x around 0
Simplified89.1%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (<= y -2.85e-77) 1.0 (if (<= y 6.2e-99) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.85e-77) {
tmp = 1.0;
} else if (y <= 6.2e-99) {
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.85d-77)) then
tmp = 1.0d0
else if (y <= 6.2d-99) 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.85e-77) {
tmp = 1.0;
} else if (y <= 6.2e-99) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.85e-77: tmp = 1.0 elif y <= 6.2e-99: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.85e-77) tmp = 1.0; elseif (y <= 6.2e-99) 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.85e-77) tmp = 1.0; elseif (y <= 6.2e-99) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.85e-77], 1.0, If[LessEqual[y, 6.2e-99], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.85 \cdot 10^{-77}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-99}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.84999999999999991e-77 or 6.1999999999999997e-99 < y Initial program 99.9%
Taylor expanded in x around 0
Simplified87.9%
if -2.84999999999999991e-77 < y < 6.1999999999999997e-99Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6483.1%
Simplified83.1%
Final simplification86.1%
(FPCore (x y z t) :precision binary64 (if (<= z -6.2e-121) 1.0 (if (<= z 1.9e-86) (+ 1.0 (/ (/ x y) t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e-121) {
tmp = 1.0;
} else if (z <= 1.9e-86) {
tmp = 1.0 + ((x / y) / 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 (z <= (-6.2d-121)) then
tmp = 1.0d0
else if (z <= 1.9d-86) then
tmp = 1.0d0 + ((x / y) / 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 (z <= -6.2e-121) {
tmp = 1.0;
} else if (z <= 1.9e-86) {
tmp = 1.0 + ((x / y) / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.2e-121: tmp = 1.0 elif z <= 1.9e-86: tmp = 1.0 + ((x / y) / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.2e-121) tmp = 1.0; elseif (z <= 1.9e-86) tmp = Float64(1.0 + Float64(Float64(x / y) / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.2e-121) tmp = 1.0; elseif (z <= 1.9e-86) tmp = 1.0 + ((x / y) / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.2e-121], 1.0, If[LessEqual[z, 1.9e-86], N[(1.0 + N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-121}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-86}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -6.1999999999999997e-121 or 1.9e-86 < z Initial program 99.9%
Taylor expanded in x around 0
Simplified84.3%
if -6.1999999999999997e-121 < z < 1.9e-86Initial 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--.f6474.8%
Simplified74.8%
Taylor expanded in y around inf
/-lowering-/.f6469.4%
Simplified69.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.3e-116) (+ 1.0 (/ x (* z (- y t)))) (+ 1.0 (/ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e-116) {
tmp = 1.0 + (x / (z * (y - t)));
} 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 <= (-1.3d-116)) then
tmp = 1.0d0 + (x / (z * (y - t)))
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 <= -1.3e-116) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.3e-116: tmp = 1.0 + (x / (z * (y - t))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.3e-116) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.3e-116) tmp = 1.0 + (x / (z * (y - t))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.3e-116], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-116}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -1.3e-116Initial program 99.9%
--lowering--.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.0%
Applied egg-rr99.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
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6494.8%
Simplified94.8%
if -1.3e-116 < 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--.f6475.8%
Simplified75.8%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6478.8%
Applied egg-rr78.8%
Final simplification84.8%
(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.9%
Taylor expanded in x around 0
Simplified76.8%
herbie shell --seed 2024158
(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)))))