
(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) (- 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}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.9e+79) (not (<= y 4.5e-37))) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.9e+79) || !(y <= 4.5e-37)) {
tmp = 1.0 - ((x / 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 ((y <= (-5.9d+79)) .or. (.not. (y <= 4.5d-37))) then
tmp = 1.0d0 - ((x / 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 ((y <= -5.9e+79) || !(y <= 4.5e-37)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.9e+79) or not (y <= 4.5e-37): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.9e+79) || !(y <= 4.5e-37)) tmp = Float64(1.0 - Float64(Float64(x / 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 ((y <= -5.9e+79) || ~((y <= 4.5e-37))) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.9e+79], N[Not[LessEqual[y, 4.5e-37]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $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}\;y \leq -5.9 \cdot 10^{+79} \lor \neg \left(y \leq 4.5 \cdot 10^{-37}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -5.9e79 or 4.5000000000000004e-37 < y Initial program 99.3%
Taylor expanded in t around 0 98.0%
*-commutative98.0%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in y around inf 95.2%
if -5.9e79 < y < 4.5000000000000004e-37Initial program 99.9%
Taylor expanded in t around inf 84.3%
associate-*r/84.3%
neg-mul-184.3%
Simplified84.3%
Taylor expanded in x around 0 84.3%
+-commutative84.3%
associate-/r*83.0%
Simplified83.0%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.15e-64) (not (<= y 2.1e-150))) (- 1.0 (/ x (* y (- y t)))) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.15e-64) || !(y <= 2.1e-150)) {
tmp = 1.0 - (x / (y * (y - t)));
} 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 ((y <= (-1.15d-64)) .or. (.not. (y <= 2.1d-150))) then
tmp = 1.0d0 - (x / (y * (y - t)))
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 ((y <= -1.15e-64) || !(y <= 2.1e-150)) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.15e-64) or not (y <= 2.1e-150): tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.15e-64) || !(y <= 2.1e-150)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); 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 ((y <= -1.15e-64) || ~((y <= 2.1e-150))) tmp = 1.0 - (x / (y * (y - t))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.15e-64], N[Not[LessEqual[y, 2.1e-150]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - t), $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}\;y \leq -1.15 \cdot 10^{-64} \lor \neg \left(y \leq 2.1 \cdot 10^{-150}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.1500000000000001e-64 or 2.1000000000000001e-150 < y Initial program 99.5%
Taylor expanded in z around 0 89.6%
if -1.1500000000000001e-64 < y < 2.1000000000000001e-150Initial program 99.9%
Taylor expanded in t around inf 90.6%
associate-*r/90.6%
neg-mul-190.6%
Simplified90.6%
Taylor expanded in x around 0 90.6%
+-commutative90.6%
associate-/r*88.7%
Simplified88.7%
Final simplification89.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.4e-82)
(- 1.0 (/ (/ x (- y z)) y))
(if (<= y 2.1e-150)
(+ 1.0 (/ x (* (- y z) t)))
(- 1.0 (/ x (* y (- y t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e-82) {
tmp = 1.0 - ((x / (y - z)) / y);
} else if (y <= 2.1e-150) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 - (x / (y * (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 (y <= (-6.4d-82)) then
tmp = 1.0d0 - ((x / (y - z)) / y)
else if (y <= 2.1d-150) then
tmp = 1.0d0 + (x / ((y - z) * t))
else
tmp = 1.0d0 - (x / (y * (y - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e-82) {
tmp = 1.0 - ((x / (y - z)) / y);
} else if (y <= 2.1e-150) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 - (x / (y * (y - t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.4e-82: tmp = 1.0 - ((x / (y - z)) / y) elif y <= 2.1e-150: tmp = 1.0 + (x / ((y - z) * t)) else: tmp = 1.0 - (x / (y * (y - t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.4e-82) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); elseif (y <= 2.1e-150) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.4e-82) tmp = 1.0 - ((x / (y - z)) / y); elseif (y <= 2.1e-150) tmp = 1.0 + (x / ((y - z) * t)); else tmp = 1.0 - (x / (y * (y - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.4e-82], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-150], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{-82}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-150}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if y < -6.4000000000000002e-82Initial program 98.8%
Taylor expanded in t around 0 89.1%
*-commutative89.1%
associate-/r*90.3%
Simplified90.3%
if -6.4000000000000002e-82 < y < 2.1000000000000001e-150Initial program 99.9%
Taylor expanded in t around inf 90.3%
associate-*r/90.3%
neg-mul-190.3%
Simplified90.3%
if 2.1000000000000001e-150 < y Initial program 100.0%
Taylor expanded in z around 0 91.5%
Final simplification90.8%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e-88) 1.0 (if (<= y 1.35e-148) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-88) {
tmp = 1.0;
} else if (y <= 1.35e-148) {
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.5d-88)) then
tmp = 1.0d0
else if (y <= 1.35d-148) 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.5e-88) {
tmp = 1.0;
} else if (y <= 1.35e-148) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e-88: tmp = 1.0 elif y <= 1.35e-148: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e-88) tmp = 1.0; elseif (y <= 1.35e-148) 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.5e-88) tmp = 1.0; elseif (y <= 1.35e-148) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-88], 1.0, If[LessEqual[y, 1.35e-148], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-88}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-148}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.50000000000000004e-88 or 1.34999999999999994e-148 < y Initial program 99.5%
Taylor expanded in t around inf 73.9%
associate-*r/73.9%
neg-mul-173.9%
Simplified73.9%
Taylor expanded in x around 0 82.0%
if -2.50000000000000004e-88 < y < 1.34999999999999994e-148Initial program 99.9%
Taylor expanded in y around 0 87.1%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e-88) 1.0 (if (<= y 3.55e-37) (- 1.0 (/ x (* z t))) (- 1.0 (/ (/ x y) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-88) {
tmp = 1.0;
} else if (y <= 3.55e-37) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - ((x / y) / 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 <= (-3.5d-88)) then
tmp = 1.0d0
else if (y <= 3.55d-37) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 - ((x / y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-88) {
tmp = 1.0;
} else if (y <= 3.55e-37) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - ((x / y) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-88: tmp = 1.0 elif y <= 3.55e-37: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - ((x / y) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-88) tmp = 1.0; elseif (y <= 3.55e-37) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 - Float64(Float64(x / y) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e-88) tmp = 1.0; elseif (y <= 3.55e-37) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 - ((x / y) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-88], 1.0, If[LessEqual[y, 3.55e-37], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-88}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.55 \cdot 10^{-37}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -3.5000000000000001e-88Initial program 98.8%
Taylor expanded in t around inf 73.5%
associate-*r/73.5%
neg-mul-173.5%
Simplified73.5%
Taylor expanded in x around 0 83.7%
if -3.5000000000000001e-88 < y < 3.54999999999999989e-37Initial program 99.9%
Taylor expanded in y around 0 81.2%
if 3.54999999999999989e-37 < y Initial program 100.0%
Taylor expanded in t around 0 98.7%
*-commutative98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in y around inf 95.7%
Final simplification86.3%
(FPCore (x y z t) :precision binary64 (if (<= t 4.6e-92) (- 1.0 (/ x (* y (- y z)))) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.6e-92) {
tmp = 1.0 - (x / (y * (y - 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 <= 4.6d-92) then
tmp = 1.0d0 - (x / (y * (y - 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 <= 4.6e-92) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 4.6e-92: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 4.6e-92) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - 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 <= 4.6e-92) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 4.6e-92], N[(1.0 - N[(x / N[(y * N[(y - z), $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}\;t \leq 4.6 \cdot 10^{-92}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 4.60000000000000032e-92Initial program 99.5%
Taylor expanded in t around 0 78.1%
if 4.60000000000000032e-92 < t Initial program 99.9%
Taylor expanded in t around inf 90.7%
associate-*r/90.7%
neg-mul-190.7%
Simplified90.7%
Taylor expanded in x around 0 90.7%
+-commutative90.7%
associate-/r*89.6%
Simplified89.6%
Final simplification81.9%
(FPCore (x y z t) :precision binary64 (if (<= t 2.6e-93) (- 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 <= 2.6e-93) {
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 <= 2.6d-93) 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 <= 2.6e-93) {
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 <= 2.6e-93: 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 <= 2.6e-93) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - 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 <= 2.6e-93) 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, 2.6e-93], N[(1.0 - N[(N[(x / N[(y - z), $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 2.6 \cdot 10^{-93}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.5999999999999998e-93Initial program 99.5%
Taylor expanded in t around 0 78.1%
*-commutative78.1%
associate-/r*78.6%
Simplified78.6%
if 2.5999999999999998e-93 < t Initial program 99.9%
Taylor expanded in t around inf 90.7%
associate-*r/90.7%
neg-mul-190.7%
Simplified90.7%
Taylor expanded in x around 0 90.7%
+-commutative90.7%
associate-/r*89.6%
Simplified89.6%
Final simplification82.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.1e-163) 1.0 (+ 1.0 (/ x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e-163) {
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 <= (-1.1d-163)) 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 <= -1.1e-163) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.1e-163: tmp = 1.0 else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e-163) 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 <= -1.1e-163) tmp = 1.0; else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e-163], 1.0, N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-163}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.10000000000000005e-163Initial program 99.9%
Taylor expanded in t around inf 82.4%
associate-*r/82.4%
neg-mul-182.4%
Simplified82.4%
Taylor expanded in x around 0 78.4%
if -1.10000000000000005e-163 < z Initial program 99.4%
Taylor expanded in t around inf 78.0%
associate-*r/78.0%
neg-mul-178.0%
Simplified78.0%
Taylor expanded in y around inf 55.3%
+-commutative55.3%
Simplified55.3%
Final simplification64.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.6%
Taylor expanded in t around inf 79.7%
associate-*r/79.7%
neg-mul-179.7%
Simplified79.7%
Taylor expanded in x around 0 73.0%
Final simplification73.0%
herbie shell --seed 2023333
(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)))))