
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 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 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 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 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))) (t_2 (/ (+ x (/ (- x (* y z)) t_1)) (+ x 1.0))))
(if (<= t_2 -1e+139)
(/ (+ x (* y (- (/ (/ x y) t_1) (/ z t_1)))) (+ x 1.0))
(if (<= t_2 2e+278)
(/ (+ x (* (/ (/ 1.0 z) (- t (/ x z))) (- (* y z) x))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double t_2 = (x + ((x - (y * z)) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -1e+139) {
tmp = (x + (y * (((x / y) / t_1) - (z / t_1)))) / (x + 1.0);
} else if (t_2 <= 2e+278) {
tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (z * t)
t_2 = (x + ((x - (y * z)) / t_1)) / (x + 1.0d0)
if (t_2 <= (-1d+139)) then
tmp = (x + (y * (((x / y) / t_1) - (z / t_1)))) / (x + 1.0d0)
else if (t_2 <= 2d+278) then
tmp = (x + (((1.0d0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0d0)
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double t_2 = (x + ((x - (y * z)) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -1e+139) {
tmp = (x + (y * (((x / y) / t_1) - (z / t_1)))) / (x + 1.0);
} else if (t_2 <= 2e+278) {
tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) t_2 = (x + ((x - (y * z)) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -1e+139: tmp = (x + (y * (((x / y) / t_1) - (z / t_1)))) / (x + 1.0) elif t_2 <= 2e+278: tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) t_2 = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -1e+139) tmp = Float64(Float64(x + Float64(y * Float64(Float64(Float64(x / y) / t_1) - Float64(z / t_1)))) / Float64(x + 1.0)); elseif (t_2 <= 2e+278) tmp = Float64(Float64(x + Float64(Float64(Float64(1.0 / z) / Float64(t - Float64(x / z))) * Float64(Float64(y * z) - x))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); t_2 = (x + ((x - (y * z)) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -1e+139) tmp = (x + (y * (((x / y) / t_1) - (z / t_1)))) / (x + 1.0); elseif (t_2 <= 2e+278) tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+139], N[(N[(x + N[(y * N[(N[(N[(x / y), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+278], N[(N[(x + N[(N[(N[(1.0 / z), $MachinePrecision] / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
t_2 := \frac{x + \frac{x - y \cdot z}{t\_1}}{x + 1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+139}:\\
\;\;\;\;\frac{x + y \cdot \left(\frac{\frac{x}{y}}{t\_1} - \frac{z}{t\_1}\right)}{x + 1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+278}:\\
\;\;\;\;\frac{x + \frac{\frac{1}{z}}{t - \frac{x}{z}} \cdot \left(y \cdot z - x\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -1.00000000000000003e139Initial program 77.0%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6477.0%
Simplified77.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.8%
Simplified99.8%
if -1.00000000000000003e139 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.99999999999999993e278Initial program 98.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6498.9%
Simplified98.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6498.9%
Simplified98.9%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.1%
Applied egg-rr99.1%
if 1.99999999999999993e278 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 13.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6413.9%
Simplified13.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6487.7%
Simplified87.7%
Final simplification98.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ (+ x (/ (- x (* y z)) (- x (* z t)))) (+ x 1.0)) 2e+278) (/ (+ x (* (/ (/ 1.0 z) (- t (/ x z))) (- (* y z) x))) (+ x 1.0)) (/ (+ x (/ y t)) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0)) <= 2e+278) {
tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 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 (((x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0d0)) <= 2d+278) then
tmp = (x + (((1.0d0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0d0)
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0)) <= 2e+278) {
tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0)) <= 2e+278: tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)) <= 2e+278) tmp = Float64(Float64(x + Float64(Float64(Float64(1.0 / z) / Float64(t - Float64(x / z))) * Float64(Float64(y * z) - x))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0)) <= 2e+278) tmp = (x + (((1.0 / z) / (t - (x / z))) * ((y * z) - x))) / (x + 1.0); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 2e+278], N[(N[(x + N[(N[(N[(1.0 / z), $MachinePrecision] / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{x - y \cdot z}{x - z \cdot t}}{x + 1} \leq 2 \cdot 10^{+278}:\\
\;\;\;\;\frac{x + \frac{\frac{1}{z}}{t - \frac{x}{z}} \cdot \left(y \cdot z - x\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.99999999999999993e278Initial program 96.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6496.9%
Simplified96.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6496.9%
Simplified96.9%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6497.0%
Applied egg-rr97.0%
if 1.99999999999999993e278 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 13.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6413.9%
Simplified13.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6487.7%
Simplified87.7%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (+ x (/ (- x (* y z)) (- x (* z t)))) (+ x 1.0)))) (if (<= t_1 2e+278) t_1 (/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= 2e+278) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 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) :: t_1
real(8) :: tmp
t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0d0)
if (t_1 <= 2d+278) then
tmp = t_1
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0);
double tmp;
if (t_1 <= 2e+278) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0) tmp = 0 if t_1 <= 2e+278: tmp = t_1 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(x - Float64(y * z)) / Float64(x - Float64(z * t)))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= 2e+278) tmp = t_1; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + ((x - (y * z)) / (x - (z * t)))) / (x + 1.0); tmp = 0.0; if (t_1 <= 2e+278) tmp = t_1; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+278], t$95$1, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{x - y \cdot z}{x - z \cdot t}}{x + 1}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.99999999999999993e278Initial program 96.9%
if 1.99999999999999993e278 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 13.9%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6413.9%
Simplified13.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6487.7%
Simplified87.7%
Final simplification96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -1.7e+168)
t_1
(if (<= z 3.5e-126)
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
(if (<= z 6e+19) (/ (+ 1.0 (- x (* y (/ z x)))) (+ x 1.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -1.7e+168) {
tmp = t_1;
} else if (z <= 3.5e-126) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (z <= 6e+19) {
tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (z <= (-1.7d+168)) then
tmp = t_1
else if (z <= 3.5d-126) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else if (z <= 6d+19) then
tmp = (1.0d0 + (x - (y * (z / x)))) / (x + 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -1.7e+168) {
tmp = t_1;
} else if (z <= 3.5e-126) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (z <= 6e+19) {
tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -1.7e+168: tmp = t_1 elif z <= 3.5e-126: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) elif z <= 6e+19: tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -1.7e+168) tmp = t_1; elseif (z <= 3.5e-126) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); elseif (z <= 6e+19) tmp = Float64(Float64(1.0 + Float64(x - Float64(y * Float64(z / x)))) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -1.7e+168) tmp = t_1; elseif (z <= 3.5e-126) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); elseif (z <= 6e+19) tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+168], t$95$1, If[LessEqual[z, 3.5e-126], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+19], N[(N[(1.0 + N[(x - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-126}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+19}:\\
\;\;\;\;\frac{1 + \left(x - y \cdot \frac{z}{x}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.70000000000000001e168 or 6e19 < z Initial program 76.3%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6476.3%
Simplified76.3%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6491.3%
Simplified91.3%
if -1.70000000000000001e168 < z < 3.5e-126Initial program 96.6%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6496.6%
Simplified96.6%
Taylor expanded in x around inf
Simplified85.3%
if 3.5e-126 < z < 6e19Initial program 99.6%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.6%
Simplified99.6%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6476.2%
Simplified76.2%
Final simplification86.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -3.4e-91)
t_1
(if (<= t 2.75e-15) (/ (+ 1.0 (- x (* y (/ z x)))) (+ x 1.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -3.4e-91) {
tmp = t_1;
} else if (t <= 2.75e-15) {
tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-3.4d-91)) then
tmp = t_1
else if (t <= 2.75d-15) then
tmp = (1.0d0 + (x - (y * (z / x)))) / (x + 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -3.4e-91) {
tmp = t_1;
} else if (t <= 2.75e-15) {
tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -3.4e-91: tmp = t_1 elif t <= 2.75e-15: tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -3.4e-91) tmp = t_1; elseif (t <= 2.75e-15) tmp = Float64(Float64(1.0 + Float64(x - Float64(y * Float64(z / x)))) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -3.4e-91) tmp = t_1; elseif (t <= 2.75e-15) tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-91], t$95$1, If[LessEqual[t, 2.75e-15], N[(N[(1.0 + N[(x - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-15}:\\
\;\;\;\;\frac{1 + \left(x - y \cdot \frac{z}{x}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.40000000000000027e-91 or 2.7500000000000001e-15 < t Initial program 84.6%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6484.6%
Simplified84.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6488.2%
Simplified88.2%
if -3.40000000000000027e-91 < t < 2.7500000000000001e-15Initial program 95.3%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6495.3%
Simplified95.3%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6479.8%
Simplified79.8%
Final simplification84.7%
(FPCore (x y z t) :precision binary64 (if (<= x -3.9e-13) 1.0 (if (<= x 3.35e-12) (+ x (/ (- y (/ x z)) t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.9e-13) {
tmp = 1.0;
} else if (x <= 3.35e-12) {
tmp = x + ((y - (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 (x <= (-3.9d-13)) then
tmp = 1.0d0
else if (x <= 3.35d-12) then
tmp = x + ((y - (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 (x <= -3.9e-13) {
tmp = 1.0;
} else if (x <= 3.35e-12) {
tmp = x + ((y - (x / z)) / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.9e-13: tmp = 1.0 elif x <= 3.35e-12: tmp = x + ((y - (x / z)) / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.9e-13) tmp = 1.0; elseif (x <= 3.35e-12) tmp = Float64(x + Float64(Float64(y - Float64(x / z)) / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.9e-13) tmp = 1.0; elseif (x <= 3.35e-12) tmp = x + ((y - (x / z)) / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.9e-13], 1.0, If[LessEqual[x, 3.35e-12], N[(x + N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-13}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.35 \cdot 10^{-12}:\\
\;\;\;\;x + \frac{y - \frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.90000000000000004e-13 or 3.3500000000000001e-12 < x Initial program 89.0%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.0%
Simplified89.0%
Taylor expanded in x around inf
Simplified89.9%
if -3.90000000000000004e-13 < x < 3.3500000000000001e-12Initial program 89.3%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.3%
Simplified89.3%
Taylor expanded in t around -inf
+-lowering-+.f64N/A
associate-*r/N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
distribute-lft-inN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6473.1%
Simplified73.1%
Taylor expanded in x around 0
Simplified72.9%
Final simplification81.8%
(FPCore (x y z t) :precision binary64 (if (<= x -1.3e-14) 1.0 (if (<= x 3.15e+72) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.3e-14) {
tmp = 1.0;
} else if (x <= 3.15e+72) {
tmp = (x + (y / t)) / (x + 1.0);
} 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 (x <= (-1.3d-14)) then
tmp = 1.0d0
else if (x <= 3.15d+72) then
tmp = (x + (y / t)) / (x + 1.0d0)
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 (x <= -1.3e-14) {
tmp = 1.0;
} else if (x <= 3.15e+72) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.3e-14: tmp = 1.0 elif x <= 3.15e+72: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.3e-14) tmp = 1.0; elseif (x <= 3.15e+72) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.3e-14) tmp = 1.0; elseif (x <= 3.15e+72) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.3e-14], 1.0, If[LessEqual[x, 3.15e+72], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-14}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.15 \cdot 10^{+72}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.29999999999999998e-14 or 3.14999999999999981e72 < x Initial program 91.1%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6491.1%
Simplified91.1%
Taylor expanded in x around inf
Simplified95.5%
if -1.29999999999999998e-14 < x < 3.14999999999999981e72Initial program 87.6%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6487.6%
Simplified87.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6465.3%
Simplified65.3%
Final simplification78.4%
(FPCore (x y z t) :precision binary64 (if (<= x -1.2e-23) 1.0 (if (<= x -3.3e-99) x (if (<= x 1.2e-49) (/ y t) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.2e-23) {
tmp = 1.0;
} else if (x <= -3.3e-99) {
tmp = x;
} else if (x <= 1.2e-49) {
tmp = 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 (x <= (-1.2d-23)) then
tmp = 1.0d0
else if (x <= (-3.3d-99)) then
tmp = x
else if (x <= 1.2d-49) then
tmp = 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 (x <= -1.2e-23) {
tmp = 1.0;
} else if (x <= -3.3e-99) {
tmp = x;
} else if (x <= 1.2e-49) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.2e-23: tmp = 1.0 elif x <= -3.3e-99: tmp = x elif x <= 1.2e-49: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.2e-23) tmp = 1.0; elseif (x <= -3.3e-99) tmp = x; elseif (x <= 1.2e-49) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.2e-23) tmp = 1.0; elseif (x <= -3.3e-99) tmp = x; elseif (x <= 1.2e-49) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.2e-23], 1.0, If[LessEqual[x, -3.3e-99], x, If[LessEqual[x, 1.2e-49], N[(y / t), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-23}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-99}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.19999999999999998e-23 or 1.19999999999999996e-49 < x Initial program 89.5%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.5%
Simplified89.5%
Taylor expanded in x around inf
Simplified87.6%
if -1.19999999999999998e-23 < x < -3.29999999999999986e-99Initial program 95.0%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6495.0%
Simplified95.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6456.9%
Simplified56.9%
Taylor expanded in x around 0
Simplified56.9%
Taylor expanded in y around 0
Simplified45.7%
if -3.29999999999999986e-99 < x < 1.19999999999999996e-49Initial program 87.4%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6487.4%
Simplified87.4%
Taylor expanded in x around 0
/-lowering-/.f6452.9%
Simplified52.9%
(FPCore (x y z t) :precision binary64 (if (<= x -1.55e-22) 1.0 (if (<= x 3.4e-8) (+ x (/ y t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.55e-22) {
tmp = 1.0;
} else if (x <= 3.4e-8) {
tmp = 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 (x <= (-1.55d-22)) then
tmp = 1.0d0
else if (x <= 3.4d-8) then
tmp = 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 (x <= -1.55e-22) {
tmp = 1.0;
} else if (x <= 3.4e-8) {
tmp = x + (y / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.55e-22: tmp = 1.0 elif x <= 3.4e-8: tmp = x + (y / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.55e-22) tmp = 1.0; elseif (x <= 3.4e-8) tmp = Float64(x + Float64(y / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.55e-22) tmp = 1.0; elseif (x <= 3.4e-8) tmp = x + (y / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.55e-22], 1.0, If[LessEqual[x, 3.4e-8], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-22}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.55000000000000006e-22 or 3.4e-8 < x Initial program 89.1%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.1%
Simplified89.1%
Taylor expanded in x around inf
Simplified89.3%
if -1.55000000000000006e-22 < x < 3.4e-8Initial program 89.1%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.1%
Simplified89.1%
Taylor expanded in z around inf
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6464.6%
Simplified64.6%
Taylor expanded in x around 0
Simplified64.4%
/-rgt-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f6464.4%
Applied egg-rr64.4%
Final simplification77.6%
(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 89.1%
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
sub0-negN/A
distribute-frac-negN/A
sub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f6489.1%
Simplified89.1%
Taylor expanded in x around inf
Simplified55.9%
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 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 = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2024161
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1)))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))