
(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%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.5e-256)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 3.7e-48)
(+ 1.0 (* x (/ (/ -1.0 y) (- y z))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.5e-256) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.7e-48) {
tmp = 1.0 + (x * ((-1.0 / 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 <= (-1.5d-256)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 3.7d-48) then
tmp = 1.0d0 + (x * (((-1.0d0) / 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 <= -1.5e-256) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.7e-48) {
tmp = 1.0 + (x * ((-1.0 / y) / (y - z)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.5e-256: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 3.7e-48: tmp = 1.0 + (x * ((-1.0 / y) / (y - z))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.5e-256) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 3.7e-48) tmp = Float64(1.0 + Float64(x * Float64(Float64(-1.0 / 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 <= -1.5e-256) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 3.7e-48) tmp = 1.0 + (x * ((-1.0 / y) / (y - z))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.5e-256], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-48], N[(1.0 + N[(x * N[(N[(-1.0 / y), $MachinePrecision] / 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 -1.5 \cdot 10^{-256}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-48}:\\
\;\;\;\;1 + x \cdot \frac{\frac{-1}{y}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.4999999999999999e-256Initial program 99.9%
Taylor expanded in z around inf 84.0%
+-commutative84.0%
associate-/r*83.2%
Simplified83.2%
if -1.4999999999999999e-256 < t < 3.6999999999999998e-48Initial program 98.1%
clear-num98.0%
associate-/r/98.0%
*-commutative98.0%
associate-/r*98.0%
Applied egg-rr98.0%
Taylor expanded in y around inf 85.9%
if 3.6999999999999998e-48 < t Initial program 99.9%
Taylor expanded in t around inf 97.5%
+-commutative97.5%
associate-/r*97.5%
Simplified97.5%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (<= t -1.2e-252) (+ 1.0 (/ (/ x z) (- y t))) (if (<= t 1e-51) (+ 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 <= -1.2e-252) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1e-51) {
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 <= (-1.2d-252)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1d-51) 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 <= -1.2e-252) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1e-51) {
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 <= -1.2e-252: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1e-51: 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 <= -1.2e-252) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1e-51) tmp = Float64(1.0 + Float64(x / Float64(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 <= -1.2e-252) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1e-51) 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, -1.2e-252], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-51], N[(1.0 + N[(x / N[(y * N[(z - 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}\;t \leq -1.2 \cdot 10^{-252}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 10^{-51}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.2000000000000001e-252Initial program 99.9%
Taylor expanded in z around inf 84.0%
+-commutative84.0%
associate-/r*83.2%
Simplified83.2%
if -1.2000000000000001e-252 < t < 1e-51Initial program 98.1%
Taylor expanded in t around 0 86.0%
if 1e-51 < t Initial program 99.9%
Taylor expanded in t around inf 97.5%
+-commutative97.5%
associate-/r*97.5%
Simplified97.5%
Final simplification88.1%
(FPCore (x y z t)
:precision binary64
(if (<= t 2.5e-184)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 3.5e-75)
(+ 1.0 (/ -1.0 (* y (/ y x))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.5e-184) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.5e-75) {
tmp = 1.0 + (-1.0 / (y * (y / x)));
} 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.5d-184) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 3.5d-75) then
tmp = 1.0d0 + ((-1.0d0) / (y * (y / x)))
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.5e-184) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.5e-75) {
tmp = 1.0 + (-1.0 / (y * (y / x)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.5e-184: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 3.5e-75: tmp = 1.0 + (-1.0 / (y * (y / x))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.5e-184) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 3.5e-75) tmp = Float64(1.0 + Float64(-1.0 / Float64(y * Float64(y / x)))); 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.5e-184) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 3.5e-75) tmp = 1.0 + (-1.0 / (y * (y / x))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.5e-184], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-75], N[(1.0 + N[(-1.0 / N[(y * N[(y / x), $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 2.5 \cdot 10^{-184}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-75}:\\
\;\;\;\;1 + \frac{-1}{y \cdot \frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.50000000000000001e-184Initial program 99.3%
Taylor expanded in z around inf 82.9%
+-commutative82.9%
associate-/r*82.3%
Simplified82.3%
if 2.50000000000000001e-184 < t < 3.49999999999999985e-75Initial program 99.9%
Taylor expanded in z around 0 74.3%
clear-num74.3%
inv-pow74.3%
associate-/l*74.4%
Applied egg-rr74.4%
unpow-174.4%
Simplified74.4%
Taylor expanded in y around inf 74.2%
if 3.49999999999999985e-75 < t Initial program 99.9%
Taylor expanded in t around inf 95.1%
+-commutative95.1%
associate-/r*95.1%
Simplified95.1%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (<= t 8e-187) (+ 1.0 (/ (/ x z) (- y t))) (if (<= t 3.8e-75) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8e-187) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.8e-75) {
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 (t <= 8d-187) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 3.8d-75) 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 (t <= 8e-187) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.8e-75) {
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 t <= 8e-187: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 3.8e-75: 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 (t <= 8e-187) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 3.8e-75) 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 (t <= 8e-187) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 3.8e-75) 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[LessEqual[t, 8e-187], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-75], 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}\;t \leq 8 \cdot 10^{-187}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-75}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 8.0000000000000001e-187Initial program 99.3%
Taylor expanded in z around inf 82.9%
+-commutative82.9%
associate-/r*82.3%
Simplified82.3%
if 8.0000000000000001e-187 < t < 3.79999999999999994e-75Initial program 99.9%
Taylor expanded in z around 0 74.3%
*-un-lft-identity74.3%
times-frac74.3%
Applied egg-rr74.3%
associate-*l/74.3%
*-un-lft-identity74.3%
Applied egg-rr74.3%
Taylor expanded in y around inf 74.2%
if 3.79999999999999994e-75 < t Initial program 99.9%
Taylor expanded in t around inf 95.1%
+-commutative95.1%
associate-/r*95.1%
Simplified95.1%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (<= t -8.8e-253) 1.0 (if (<= t 3.7e-75) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.8e-253) {
tmp = 1.0;
} else if (t <= 3.7e-75) {
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 (t <= (-8.8d-253)) then
tmp = 1.0d0
else if (t <= 3.7d-75) 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 (t <= -8.8e-253) {
tmp = 1.0;
} else if (t <= 3.7e-75) {
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 t <= -8.8e-253: tmp = 1.0 elif t <= 3.7e-75: 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 (t <= -8.8e-253) tmp = 1.0; elseif (t <= 3.7e-75) 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 (t <= -8.8e-253) tmp = 1.0; elseif (t <= 3.7e-75) 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[LessEqual[t, -8.8e-253], 1.0, If[LessEqual[t, 3.7e-75], 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}\;t \leq -8.8 \cdot 10^{-253}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-75}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -8.79999999999999983e-253Initial program 99.9%
Taylor expanded in x around 0 85.5%
if -8.79999999999999983e-253 < t < 3.70000000000000024e-75Initial program 98.0%
Taylor expanded in z around 0 64.3%
*-un-lft-identity64.3%
times-frac66.2%
Applied egg-rr66.2%
associate-*l/66.2%
*-un-lft-identity66.2%
Applied egg-rr66.2%
Taylor expanded in y around inf 68.2%
if 3.70000000000000024e-75 < t Initial program 99.9%
Taylor expanded in t around inf 95.1%
+-commutative95.1%
associate-/r*95.1%
Simplified95.1%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= y -4.3e-184) 1.0 (if (<= y 3.15e-114) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e-184) {
tmp = 1.0;
} else if (y <= 3.15e-114) {
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.3d-184)) then
tmp = 1.0d0
else if (y <= 3.15d-114) 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.3e-184) {
tmp = 1.0;
} else if (y <= 3.15e-114) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.3e-184: tmp = 1.0 elif y <= 3.15e-114: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.3e-184) tmp = 1.0; elseif (y <= 3.15e-114) 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.3e-184) tmp = 1.0; elseif (y <= 3.15e-114) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.3e-184], 1.0, If[LessEqual[y, 3.15e-114], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-184}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{-114}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.30000000000000007e-184 or 3.15000000000000007e-114 < y Initial program 100.0%
Taylor expanded in x around 0 86.5%
if -4.30000000000000007e-184 < y < 3.15000000000000007e-114Initial program 98.4%
Taylor expanded in y around 0 82.5%
Final simplification85.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e-28) (+ 1.0 (/ (/ x z) (- y t))) (+ 1.0 (/ x (* y (- t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-28) {
tmp = 1.0 + ((x / z) / (y - 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 (z <= (-1.8d-28)) then
tmp = 1.0d0 + ((x / z) / (y - 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 (z <= -1.8e-28) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e-28: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e-28) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - 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 (z <= -1.8e-28) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e-28], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - 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}\;z \leq -1.8 \cdot 10^{-28}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if z < -1.7999999999999999e-28Initial program 100.0%
Taylor expanded in z around inf 98.6%
+-commutative98.6%
associate-/r*98.6%
Simplified98.6%
if -1.7999999999999999e-28 < z Initial program 99.4%
Taylor expanded in z around 0 84.0%
Final simplification88.0%
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e-176) 1.0 (+ 1.0 (/ x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e-176) {
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 <= (-4.2d-176)) 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 <= -4.2e-176) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e-176: tmp = 1.0 else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e-176) 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 <= -4.2e-176) tmp = 1.0; else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e-176], 1.0, N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-176}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -4.19999999999999984e-176Initial program 99.9%
Taylor expanded in x around 0 86.1%
if -4.19999999999999984e-176 < z Initial program 99.3%
Taylor expanded in t around inf 85.7%
+-commutative85.7%
associate-/r*85.0%
Simplified85.0%
Taylor expanded in y around inf 69.6%
Final simplification76.3%
(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 78.5%
herbie shell --seed 2024103
(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)))))