
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* (- y z) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (x / ((y - z) * (t - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - z) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.05e-207)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 5.1e-80)
(+ 1.0 (* (/ x y) (/ 1.0 (- z y))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.05e-207) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 5.1e-80) {
tmp = 1.0 + ((x / y) * (1.0 / (z - 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 (t <= (-2.05d-207)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 5.1d-80) then
tmp = 1.0d0 + ((x / y) * (1.0d0 / (z - 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 (t <= -2.05e-207) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 5.1e-80) {
tmp = 1.0 + ((x / y) * (1.0 / (z - y)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.05e-207: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 5.1e-80: tmp = 1.0 + ((x / y) * (1.0 / (z - y))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.05e-207) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 5.1e-80) tmp = Float64(1.0 + Float64(Float64(x / y) * Float64(1.0 / Float64(z - 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 (t <= -2.05e-207) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 5.1e-80) tmp = 1.0 + ((x / y) * (1.0 / (z - y))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.05e-207], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.1e-80], N[(1.0 + N[(N[(x / y), $MachinePrecision] * N[(1.0 / N[(z - 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}\;t \leq -2.05 \cdot 10^{-207}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{-80}:\\
\;\;\;\;1 + \frac{x}{y} \cdot \frac{1}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -2.0499999999999999e-207Initial program 98.2%
Taylor expanded in z around inf 78.4%
+-commutative78.4%
associate-/r*78.3%
Simplified78.3%
if -2.0499999999999999e-207 < t < 5.10000000000000008e-80Initial program 98.2%
Taylor expanded in t around 0 83.3%
associate-/r*82.3%
div-inv82.3%
Applied egg-rr82.3%
if 5.10000000000000008e-80 < t Initial program 99.9%
Taylor expanded in t around inf 98.0%
+-commutative98.0%
Simplified98.0%
Final simplification85.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.2e-109) (not (<= t 1.86e-146))) (+ 1.0 (/ x (* (- y z) t))) (+ 1.0 (/ x (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.2e-109) || !(t <= 1.86e-146)) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 + (x / (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 <= (-7.2d-109)) .or. (.not. (t <= 1.86d-146))) then
tmp = 1.0d0 + (x / ((y - z) * t))
else
tmp = 1.0d0 + (x / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.2e-109) || !(t <= 1.86e-146)) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 + (x / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.2e-109) or not (t <= 1.86e-146): tmp = 1.0 + (x / ((y - z) * t)) else: tmp = 1.0 + (x / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.2e-109) || !(t <= 1.86e-146)) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); else tmp = Float64(1.0 + Float64(x / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7.2e-109) || ~((t <= 1.86e-146))) tmp = 1.0 + (x / ((y - z) * t)); else tmp = 1.0 + (x / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.2e-109], N[Not[LessEqual[t, 1.86e-146]], $MachinePrecision]], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{-109} \lor \neg \left(t \leq 1.86 \cdot 10^{-146}\right):\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\end{array}
\end{array}
if t < -7.2000000000000001e-109 or 1.85999999999999994e-146 < t Initial program 99.9%
Taylor expanded in t around inf 93.9%
+-commutative93.9%
Simplified93.9%
if -7.2000000000000001e-109 < t < 1.85999999999999994e-146Initial program 95.4%
Taylor expanded in z around inf 77.8%
+-commutative77.8%
associate-/r*79.3%
Simplified79.3%
Taylor expanded in y around inf 65.2%
*-commutative65.2%
Simplified65.2%
Final simplification86.1%
(FPCore (x y z t) :precision binary64 (if (<= t -3.2e-105) (+ 1.0 (/ (/ x t) (- y z))) (if (<= t 8.2e-147) (+ 1.0 (/ x (* y z))) (+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.2e-105) {
tmp = 1.0 + ((x / t) / (y - z));
} else if (t <= 8.2e-147) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.2d-105)) then
tmp = 1.0d0 + ((x / t) / (y - z))
else if (t <= 8.2d-147) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0 + (x / ((y - z) * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.2e-105) {
tmp = 1.0 + ((x / t) / (y - z));
} else if (t <= 8.2e-147) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.2e-105: tmp = 1.0 + ((x / t) / (y - z)) elif t <= 8.2e-147: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.2e-105) tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); elseif (t <= 8.2e-147) tmp = Float64(1.0 + Float64(x / Float64(y * z))); 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 (t <= -3.2e-105) tmp = 1.0 + ((x / t) / (y - z)); elseif (t <= 8.2e-147) tmp = 1.0 + (x / (y * z)); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.2e-105], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2e-147], N[(1.0 + N[(x / N[(y * z), $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}\;t \leq -3.2 \cdot 10^{-105}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-147}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -3.19999999999999981e-105Initial program 100.0%
Taylor expanded in t around inf 93.9%
+-commutative93.9%
associate-/r*92.8%
Simplified92.8%
if -3.19999999999999981e-105 < t < 8.1999999999999999e-147Initial program 95.4%
Taylor expanded in z around inf 77.8%
+-commutative77.8%
associate-/r*79.3%
Simplified79.3%
Taylor expanded in y around inf 65.2%
*-commutative65.2%
Simplified65.2%
if 8.1999999999999999e-147 < t Initial program 99.9%
Taylor expanded in t around inf 93.9%
+-commutative93.9%
Simplified93.9%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -8.5e-208)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 8.8e-80)
(+ 1.0 (/ x (* y (- z y))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.5e-208) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 8.8e-80) {
tmp = 1.0 + (x / (y * (z - 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 (t <= (-8.5d-208)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 8.8d-80) then
tmp = 1.0d0 + (x / (y * (z - 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 (t <= -8.5e-208) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 8.8e-80) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.5e-208: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 8.8e-80: tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.5e-208) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 8.8e-80) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - 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 (t <= -8.5e-208) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 8.8e-80) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.5e-208], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e-80], N[(1.0 + N[(x / N[(y * N[(z - 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}\;t \leq -8.5 \cdot 10^{-208}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-80}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -8.49999999999999997e-208Initial program 98.2%
Taylor expanded in z around inf 78.4%
+-commutative78.4%
associate-/r*78.3%
Simplified78.3%
if -8.49999999999999997e-208 < t < 8.80000000000000041e-80Initial program 98.2%
Taylor expanded in t around 0 83.3%
if 8.80000000000000041e-80 < t Initial program 99.9%
Taylor expanded in t around inf 98.0%
+-commutative98.0%
Simplified98.0%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -1e-207)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 3.85e-79)
(+ 1.0 (/ (/ x y) (- z y)))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e-207) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.85e-79) {
tmp = 1.0 + ((x / y) / (z - 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 (t <= (-1d-207)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 3.85d-79) then
tmp = 1.0d0 + ((x / y) / (z - 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 (t <= -1e-207) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.85e-79) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1e-207: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 3.85e-79: tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1e-207) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 3.85e-79) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - 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 (t <= -1e-207) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 3.85e-79) tmp = 1.0 + ((x / y) / (z - y)); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1e-207], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.85e-79], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $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}\;t \leq -1 \cdot 10^{-207}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 3.85 \cdot 10^{-79}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -9.99999999999999925e-208Initial program 98.2%
Taylor expanded in z around inf 78.4%
+-commutative78.4%
associate-/r*78.3%
Simplified78.3%
if -9.99999999999999925e-208 < t < 3.8499999999999998e-79Initial program 98.2%
Taylor expanded in t around 0 83.5%
associate-/r*82.5%
Simplified82.5%
if 3.8499999999999998e-79 < t Initial program 99.9%
Taylor expanded in t around inf 98.0%
+-commutative98.0%
Simplified98.0%
Final simplification85.4%
(FPCore (x y z t) :precision binary64 (if (<= y -8.5e-69) 1.0 (if (<= y 4.1e-106) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e-69) {
tmp = 1.0;
} else if (y <= 4.1e-106) {
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 <= (-8.5d-69)) then
tmp = 1.0d0
else if (y <= 4.1d-106) 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 <= -8.5e-69) {
tmp = 1.0;
} else if (y <= 4.1e-106) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.5e-69: tmp = 1.0 elif y <= 4.1e-106: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.5e-69) tmp = 1.0; elseif (y <= 4.1e-106) 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 <= -8.5e-69) tmp = 1.0; elseif (y <= 4.1e-106) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.5e-69], 1.0, If[LessEqual[y, 4.1e-106], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-69}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-106}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -8.50000000000000046e-69 or 4.0999999999999999e-106 < y Initial program 100.0%
Taylor expanded in x around 0 86.5%
if -8.50000000000000046e-69 < y < 4.0999999999999999e-106Initial program 96.5%
Taylor expanded in y around 0 79.5%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (<= y -3.1e-191) 1.0 (if (<= y 2.25e-259) (/ (- x) (* z t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-191) {
tmp = 1.0;
} else if (y <= 2.25e-259) {
tmp = -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 <= (-3.1d-191)) then
tmp = 1.0d0
else if (y <= 2.25d-259) then
tmp = -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 <= -3.1e-191) {
tmp = 1.0;
} else if (y <= 2.25e-259) {
tmp = -x / (z * t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e-191: tmp = 1.0 elif y <= 2.25e-259: tmp = -x / (z * t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-191) tmp = 1.0; elseif (y <= 2.25e-259) tmp = Float64(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 <= -3.1e-191) tmp = 1.0; elseif (y <= 2.25e-259) tmp = -x / (z * t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-191], 1.0, If[LessEqual[y, 2.25e-259], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-191}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-259}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.1000000000000002e-191 or 2.24999999999999987e-259 < y Initial program 98.9%
Taylor expanded in x around 0 79.3%
if -3.1000000000000002e-191 < y < 2.24999999999999987e-259Initial program 97.7%
Taylor expanded in t around inf 93.0%
+-commutative93.0%
Simplified93.0%
Taylor expanded in x around inf 66.4%
Taylor expanded in y around 0 57.5%
associate-*r/57.5%
neg-mul-157.5%
Simplified57.5%
Final simplification75.7%
(FPCore (x y z t) :precision binary64 (if (<= t 5.1e-144) (+ 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 (t <= 5.1e-144) {
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 (t <= 5.1d-144) 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 (t <= 5.1e-144) {
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 t <= 5.1e-144: 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 (t <= 5.1e-144) tmp = Float64(1.0 + Float64(Float64(x / 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 (t <= 5.1e-144) 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[t, 5.1e-144], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $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}\;t \leq 5.1 \cdot 10^{-144}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 5.1e-144Initial program 98.0%
Taylor expanded in z around inf 78.6%
+-commutative78.6%
associate-/r*78.6%
Simplified78.6%
if 5.1e-144 < t Initial program 99.9%
Taylor expanded in t around inf 93.9%
+-commutative93.9%
Simplified93.9%
Final simplification84.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 98.7%
Taylor expanded in x around 0 70.6%
Final simplification70.6%
herbie shell --seed 2024082
(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)))))