
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
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) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
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) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ (+ 2.0 (/ 2.0 z)) t) (+ -2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / 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 = ((2.0d0 + (2.0d0 / z)) / t) + ((-2.0d0) + (x / y))
end function
public static double code(double x, double y, double z, double t) {
return ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y));
}
def code(x, y, z, t): return ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + Float64(-2.0 + Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = ((2.0 + (2.0 / z)) / t) + (-2.0 + (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2 + \frac{2}{z}}{t} + \left(-2 + \frac{x}{y}\right)
\end{array}
Initial program 84.2%
Simplified99.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -2e+30)
t_1
(if (<= (/ x y) -2e-33)
(/ (+ 2.0 (/ 2.0 z)) t)
(if (<= (/ x y) 1e-14) (+ -2.0 (/ (/ 2.0 z) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -2e+30) {
tmp = t_1;
} else if ((x / y) <= -2e-33) {
tmp = (2.0 + (2.0 / z)) / t;
} else if ((x / y) <= 1e-14) {
tmp = -2.0 + ((2.0 / z) / t);
} 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) + (2.0d0 / t)
if ((x / y) <= (-2d+30)) then
tmp = t_1
else if ((x / y) <= (-2d-33)) then
tmp = (2.0d0 + (2.0d0 / z)) / t
else if ((x / y) <= 1d-14) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
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) + (2.0 / t);
double tmp;
if ((x / y) <= -2e+30) {
tmp = t_1;
} else if ((x / y) <= -2e-33) {
tmp = (2.0 + (2.0 / z)) / t;
} else if ((x / y) <= 1e-14) {
tmp = -2.0 + ((2.0 / z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -2e+30: tmp = t_1 elif (x / y) <= -2e-33: tmp = (2.0 + (2.0 / z)) / t elif (x / y) <= 1e-14: tmp = -2.0 + ((2.0 / z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -2e+30) tmp = t_1; elseif (Float64(x / y) <= -2e-33) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); elseif (Float64(x / y) <= 1e-14) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if ((x / y) <= -2e+30) tmp = t_1; elseif ((x / y) <= -2e-33) tmp = (2.0 + (2.0 / z)) / t; elseif ((x / y) <= 1e-14) tmp = -2.0 + ((2.0 / z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e+30], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -2e-33], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e-14], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -2 \cdot 10^{-33}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-14}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -2e30 or 9.99999999999999999e-15 < (/.f64 x y) Initial program 82.7%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6482.2%
Simplified82.2%
Taylor expanded in t around 0
/-lowering-/.f6481.0%
Simplified81.0%
if -2e30 < (/.f64 x y) < -2.0000000000000001e-33Initial program 91.8%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6485.3%
Simplified85.3%
if -2.0000000000000001e-33 < (/.f64 x y) < 9.99999999999999999e-15Initial program 84.8%
Simplified99.9%
Taylor expanded in x around 0
Simplified99.9%
Taylor expanded in z around 0
/-lowering-/.f6483.0%
Simplified83.0%
Final simplification82.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (+ t_1 (/ x y)))) (if (<= (/ x y) -2e+30) t_2 (if (<= (/ x y) 5e-12) (+ t_1 -2.0) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = t_1 + (x / y);
double tmp;
if ((x / y) <= -2e+30) {
tmp = t_2;
} else if ((x / y) <= 5e-12) {
tmp = t_1 + -2.0;
} else {
tmp = t_2;
}
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 = (2.0d0 + (2.0d0 / z)) / t
t_2 = t_1 + (x / y)
if ((x / y) <= (-2d+30)) then
tmp = t_2
else if ((x / y) <= 5d-12) then
tmp = t_1 + (-2.0d0)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = t_1 + (x / y);
double tmp;
if ((x / y) <= -2e+30) {
tmp = t_2;
} else if ((x / y) <= 5e-12) {
tmp = t_1 + -2.0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t t_2 = t_1 + (x / y) tmp = 0 if (x / y) <= -2e+30: tmp = t_2 elif (x / y) <= 5e-12: tmp = t_1 + -2.0 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) t_2 = Float64(t_1 + Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -2e+30) tmp = t_2; elseif (Float64(x / y) <= 5e-12) tmp = Float64(t_1 + -2.0); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + (2.0 / z)) / t; t_2 = t_1 + (x / y); tmp = 0.0; if ((x / y) <= -2e+30) tmp = t_2; elseif ((x / y) <= 5e-12) tmp = t_1 + -2.0; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e+30], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 5e-12], N[(t$95$1 + -2.0), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
t_2 := t\_1 + \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-12}:\\
\;\;\;\;t\_1 + -2\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -2e30 or 4.9999999999999997e-12 < (/.f64 x y) Initial program 82.5%
Simplified98.2%
Taylor expanded in x around inf
/-lowering-/.f6497.6%
Simplified97.6%
if -2e30 < (/.f64 x y) < 4.9999999999999997e-12Initial program 85.5%
Simplified99.9%
Taylor expanded in x around 0
Simplified99.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -0.46) (/ x y) (if (<= (/ x y) -9e-38) (/ 2.0 t) (if (<= (/ x y) 2.0) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.46) {
tmp = x / y;
} else if ((x / y) <= -9e-38) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / 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 ((x / y) <= (-0.46d0)) then
tmp = x / y
else if ((x / y) <= (-9d-38)) then
tmp = 2.0d0 / t
else if ((x / y) <= 2.0d0) then
tmp = -2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.46) {
tmp = x / y;
} else if ((x / y) <= -9e-38) {
tmp = 2.0 / t;
} else if ((x / y) <= 2.0) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -0.46: tmp = x / y elif (x / y) <= -9e-38: tmp = 2.0 / t elif (x / y) <= 2.0: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -0.46) tmp = Float64(x / y); elseif (Float64(x / y) <= -9e-38) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 2.0) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -0.46) tmp = x / y; elseif ((x / y) <= -9e-38) tmp = 2.0 / t; elseif ((x / y) <= 2.0) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -0.46], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -9e-38], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 2.0], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.46:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -9 \cdot 10^{-38}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.46000000000000002 or 2 < (/.f64 x y) Initial program 82.1%
Taylor expanded in x around inf
/-lowering-/.f6468.6%
Simplified68.6%
if -0.46000000000000002 < (/.f64 x y) < -9.00000000000000018e-38Initial program 99.5%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6468.1%
Simplified68.1%
Taylor expanded in t around 0
/-lowering-/.f6456.9%
Simplified56.9%
if -9.00000000000000018e-38 < (/.f64 x y) < 2Initial program 85.0%
Simplified99.9%
Taylor expanded in x around 0
Simplified99.8%
Taylor expanded in t around inf
Simplified39.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -2e+30)
(+ (/ x y) (/ 2.0 t))
(if (<= (/ x y) 1e-8)
(+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0)
(+ (/ x y) (/ 2.0 (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+30) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1e-8) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = (x / y) + (2.0 / (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 ((x / y) <= (-2d+30)) then
tmp = (x / y) + (2.0d0 / t)
else if ((x / y) <= 1d-8) then
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
else
tmp = (x / y) + (2.0d0 / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+30) {
tmp = (x / y) + (2.0 / t);
} else if ((x / y) <= 1e-8) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+30: tmp = (x / y) + (2.0 / t) elif (x / y) <= 1e-8: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 else: tmp = (x / y) + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+30) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (Float64(x / y) <= 1e-8) tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e+30) tmp = (x / y) + (2.0 / t); elseif ((x / y) <= 1e-8) tmp = ((2.0 + (2.0 / z)) / t) + -2.0; else tmp = (x / y) + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+30], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e-8], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-8}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if (/.f64 x y) < -2e30Initial program 76.8%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6485.9%
Simplified85.9%
Taylor expanded in t around 0
/-lowering-/.f6485.9%
Simplified85.9%
if -2e30 < (/.f64 x y) < 1e-8Initial program 85.7%
Simplified99.9%
Taylor expanded in x around 0
Simplified99.1%
if 1e-8 < (/.f64 x y) Initial program 87.1%
Taylor expanded in z around 0
Simplified89.0%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ x y))))
(if (<= z -7.8e-70)
t_1
(if (<= z 5e-79)
(/ (/ 2.0 z) t)
(if (<= z 1.5e+161) t_1 (+ (/ x y) (/ 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (z <= -7.8e-70) {
tmp = t_1;
} else if (z <= 5e-79) {
tmp = (2.0 / z) / t;
} else if (z <= 1.5e+161) {
tmp = t_1;
} else {
tmp = (x / y) + (2.0 / 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) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) + (x / y)
if (z <= (-7.8d-70)) then
tmp = t_1
else if (z <= 5d-79) then
tmp = (2.0d0 / z) / t
else if (z <= 1.5d+161) then
tmp = t_1
else
tmp = (x / y) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (z <= -7.8e-70) {
tmp = t_1;
} else if (z <= 5e-79) {
tmp = (2.0 / z) / t;
} else if (z <= 1.5e+161) {
tmp = t_1;
} else {
tmp = (x / y) + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if z <= -7.8e-70: tmp = t_1 elif z <= 5e-79: tmp = (2.0 / z) / t elif z <= 1.5e+161: tmp = t_1 else: tmp = (x / y) + (2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (z <= -7.8e-70) tmp = t_1; elseif (z <= 5e-79) tmp = Float64(Float64(2.0 / z) / t); elseif (z <= 1.5e+161) tmp = t_1; else tmp = Float64(Float64(x / y) + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (z <= -7.8e-70) tmp = t_1; elseif (z <= 5e-79) tmp = (2.0 / z) / t; elseif (z <= 1.5e+161) tmp = t_1; else tmp = (x / y) + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e-70], t$95$1, If[LessEqual[z, 5e-79], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.5e+161], t$95$1, N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\end{array}
\end{array}
if z < -7.80000000000000038e-70 or 4.99999999999999999e-79 < z < 1.50000000000000006e161Initial program 80.2%
Taylor expanded in t around inf
Simplified69.9%
if -7.80000000000000038e-70 < z < 4.99999999999999999e-79Initial program 97.7%
Taylor expanded in z around 0
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6476.2%
Simplified76.2%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.2%
Applied egg-rr76.2%
if 1.50000000000000006e161 < z Initial program 60.5%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
Taylor expanded in t around 0
/-lowering-/.f6486.0%
Simplified86.0%
Final simplification74.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))))
(if (<= (/ x y) -7.2e-10)
t_1
(if (<= (/ x y) 3e-12) (+ -2.0 (/ (/ 2.0 z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double tmp;
if ((x / y) <= -7.2e-10) {
tmp = t_1;
} else if ((x / y) <= 3e-12) {
tmp = -2.0 + ((2.0 / z) / t);
} 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) + (2.0d0 / t)
if ((x / y) <= (-7.2d-10)) then
tmp = t_1
else if ((x / y) <= 3d-12) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
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) + (2.0 / t);
double tmp;
if ((x / y) <= -7.2e-10) {
tmp = t_1;
} else if ((x / y) <= 3e-12) {
tmp = -2.0 + ((2.0 / z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) tmp = 0 if (x / y) <= -7.2e-10: tmp = t_1 elif (x / y) <= 3e-12: tmp = -2.0 + ((2.0 / z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) tmp = 0.0 if (Float64(x / y) <= -7.2e-10) tmp = t_1; elseif (Float64(x / y) <= 3e-12) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); tmp = 0.0; if ((x / y) <= -7.2e-10) tmp = t_1; elseif ((x / y) <= 3e-12) tmp = -2.0 + ((2.0 / z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -7.2e-10], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 3e-12], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
\mathbf{if}\;\frac{x}{y} \leq -7.2 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 3 \cdot 10^{-12}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -7.2e-10 or 3.0000000000000001e-12 < (/.f64 x y) Initial program 83.0%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6481.2%
Simplified81.2%
Taylor expanded in t around 0
/-lowering-/.f6478.6%
Simplified78.6%
if -7.2e-10 < (/.f64 x y) < 3.0000000000000001e-12Initial program 85.4%
Simplified99.9%
Taylor expanded in x around 0
Simplified99.9%
Taylor expanded in z around 0
/-lowering-/.f6482.2%
Simplified82.2%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) (+ -2.0 (/ 2.0 t))))) (if (<= z -900.0) t_1 (if (<= z 2.2e-32) (+ (/ x y) (/ 2.0 (* z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -900.0) {
tmp = t_1;
} else if (z <= 2.2e-32) {
tmp = (x / y) + (2.0 / (z * t));
} 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) + ((-2.0d0) + (2.0d0 / t))
if (z <= (-900.0d0)) then
tmp = t_1
else if (z <= 2.2d-32) then
tmp = (x / y) + (2.0d0 / (z * t))
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) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -900.0) {
tmp = t_1;
} else if (z <= 2.2e-32) {
tmp = (x / y) + (2.0 / (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (-2.0 + (2.0 / t)) tmp = 0 if z <= -900.0: tmp = t_1 elif z <= 2.2e-32: tmp = (x / y) + (2.0 / (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))) tmp = 0.0 if (z <= -900.0) tmp = t_1; elseif (z <= 2.2e-32) tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (-2.0 + (2.0 / t)); tmp = 0.0; if (z <= -900.0) tmp = t_1; elseif (z <= 2.2e-32) tmp = (x / y) + (2.0 / (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -900.0], t$95$1, If[LessEqual[z, 2.2e-32], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{if}\;z \leq -900:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -900 or 2.2e-32 < z Initial program 71.9%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6497.7%
Simplified97.7%
if -900 < z < 2.2e-32Initial program 98.1%
Taylor expanded in z around 0
Simplified86.6%
Final simplification92.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) (+ -2.0 (/ 2.0 t))))) (if (<= z -2.6e-69) t_1 (if (<= z 2.9e-5) (+ -2.0 (/ (/ 2.0 z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -2.6e-69) {
tmp = t_1;
} else if (z <= 2.9e-5) {
tmp = -2.0 + ((2.0 / z) / t);
} 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) + ((-2.0d0) + (2.0d0 / t))
if (z <= (-2.6d-69)) then
tmp = t_1
else if (z <= 2.9d-5) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
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) + (-2.0 + (2.0 / t));
double tmp;
if (z <= -2.6e-69) {
tmp = t_1;
} else if (z <= 2.9e-5) {
tmp = -2.0 + ((2.0 / z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (-2.0 + (2.0 / t)) tmp = 0 if z <= -2.6e-69: tmp = t_1 elif z <= 2.9e-5: tmp = -2.0 + ((2.0 / z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))) tmp = 0.0 if (z <= -2.6e-69) tmp = t_1; elseif (z <= 2.9e-5) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (-2.0 + (2.0 / t)); tmp = 0.0; if (z <= -2.6e-69) tmp = t_1; elseif (z <= 2.9e-5) tmp = -2.0 + ((2.0 / z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e-69], t$95$1, If[LessEqual[z, 2.9e-5], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-5}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.6000000000000002e-69 or 2.9e-5 < z Initial program 74.0%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6495.9%
Simplified95.9%
if -2.6000000000000002e-69 < z < 2.9e-5Initial program 97.9%
Simplified98.0%
Taylor expanded in x around 0
Simplified86.4%
Taylor expanded in z around 0
/-lowering-/.f6485.0%
Simplified85.0%
Final simplification91.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ -2.0 (/ x y))))
(if (<= (/ x y) -0.028)
t_1
(if (<= (/ x y) 5.8e-7) (+ -2.0 (/ 2.0 t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if ((x / y) <= -0.028) {
tmp = t_1;
} else if ((x / y) <= 5.8e-7) {
tmp = -2.0 + (2.0 / t);
} 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 = (-2.0d0) + (x / y)
if ((x / y) <= (-0.028d0)) then
tmp = t_1
else if ((x / y) <= 5.8d-7) then
tmp = (-2.0d0) + (2.0d0 / t)
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 = -2.0 + (x / y);
double tmp;
if ((x / y) <= -0.028) {
tmp = t_1;
} else if ((x / y) <= 5.8e-7) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if (x / y) <= -0.028: tmp = t_1 elif (x / y) <= 5.8e-7: tmp = -2.0 + (2.0 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -0.028) tmp = t_1; elseif (Float64(x / y) <= 5.8e-7) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if ((x / y) <= -0.028) tmp = t_1; elseif ((x / y) <= 5.8e-7) tmp = -2.0 + (2.0 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -0.028], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5.8e-7], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -0.028:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 5.8 \cdot 10^{-7}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0280000000000000006 or 5.7999999999999995e-7 < (/.f64 x y) Initial program 82.1%
Taylor expanded in t around inf
Simplified69.9%
if -0.0280000000000000006 < (/.f64 x y) < 5.7999999999999995e-7Initial program 86.0%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6458.1%
Simplified58.1%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6457.8%
Simplified57.8%
Final simplification63.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -36000000000.0) (/ x y) (if (<= (/ x y) 39.0) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -36000000000.0) {
tmp = x / y;
} else if ((x / y) <= 39.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / 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 ((x / y) <= (-36000000000.0d0)) then
tmp = x / y
else if ((x / y) <= 39.0d0) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -36000000000.0) {
tmp = x / y;
} else if ((x / y) <= 39.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -36000000000.0: tmp = x / y elif (x / y) <= 39.0: tmp = -2.0 + (2.0 / t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -36000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 39.0) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -36000000000.0) tmp = x / y; elseif ((x / y) <= 39.0) tmp = -2.0 + (2.0 / t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -36000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 39.0], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -36000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 39:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.6e10 or 39 < (/.f64 x y) Initial program 82.5%
Taylor expanded in x around inf
/-lowering-/.f6470.2%
Simplified70.2%
if -3.6e10 < (/.f64 x y) < 39Initial program 85.5%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6457.6%
Simplified57.6%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6456.8%
Simplified56.8%
Final simplification62.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ -2.0 (/ x y)))) (if (<= z -8.5e-70) t_1 (if (<= z 3.95e-78) (/ (/ 2.0 z) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (z <= -8.5e-70) {
tmp = t_1;
} else if (z <= 3.95e-78) {
tmp = (2.0 / z) / t;
} 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 = (-2.0d0) + (x / y)
if (z <= (-8.5d-70)) then
tmp = t_1
else if (z <= 3.95d-78) then
tmp = (2.0d0 / z) / t
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 = -2.0 + (x / y);
double tmp;
if (z <= -8.5e-70) {
tmp = t_1;
} else if (z <= 3.95e-78) {
tmp = (2.0 / z) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if z <= -8.5e-70: tmp = t_1 elif z <= 3.95e-78: tmp = (2.0 / z) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (z <= -8.5e-70) tmp = t_1; elseif (z <= 3.95e-78) tmp = Float64(Float64(2.0 / z) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (z <= -8.5e-70) tmp = t_1; elseif (z <= 3.95e-78) tmp = (2.0 / z) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e-70], t$95$1, If[LessEqual[z, 3.95e-78], N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -8.5000000000000002e-70 or 3.94999999999999985e-78 < z Initial program 76.1%
Taylor expanded in t around inf
Simplified68.2%
if -8.5000000000000002e-70 < z < 3.94999999999999985e-78Initial program 97.7%
Taylor expanded in z around 0
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6476.2%
Simplified76.2%
associate-/l/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.2%
Applied egg-rr76.2%
Final simplification71.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ -2.0 (/ x y)))) (if (<= z -2.05e-69) t_1 (if (<= z 7.5e-78) (/ (/ 2.0 t) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (z <= -2.05e-69) {
tmp = t_1;
} else if (z <= 7.5e-78) {
tmp = (2.0 / t) / z;
} 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 = (-2.0d0) + (x / y)
if (z <= (-2.05d-69)) then
tmp = t_1
else if (z <= 7.5d-78) then
tmp = (2.0d0 / t) / z
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 = -2.0 + (x / y);
double tmp;
if (z <= -2.05e-69) {
tmp = t_1;
} else if (z <= 7.5e-78) {
tmp = (2.0 / t) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if z <= -2.05e-69: tmp = t_1 elif z <= 7.5e-78: tmp = (2.0 / t) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (z <= -2.05e-69) tmp = t_1; elseif (z <= 7.5e-78) tmp = Float64(Float64(2.0 / t) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (z <= -2.05e-69) tmp = t_1; elseif (z <= 7.5e-78) tmp = (2.0 / t) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e-69], t$95$1, If[LessEqual[z, 7.5e-78], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.04999999999999995e-69 or 7.50000000000000041e-78 < z Initial program 76.1%
Taylor expanded in t around inf
Simplified68.2%
if -2.04999999999999995e-69 < z < 7.50000000000000041e-78Initial program 97.7%
Taylor expanded in z around 0
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6476.2%
Simplified76.2%
Final simplification71.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ -2.0 (/ x y)))) (if (<= z -1.3e-69) t_1 (if (<= z 3.6e-72) (/ 2.0 (* z t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -2.0 + (x / y);
double tmp;
if (z <= -1.3e-69) {
tmp = t_1;
} else if (z <= 3.6e-72) {
tmp = 2.0 / (z * t);
} 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 = (-2.0d0) + (x / y)
if (z <= (-1.3d-69)) then
tmp = t_1
else if (z <= 3.6d-72) then
tmp = 2.0d0 / (z * t)
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 = -2.0 + (x / y);
double tmp;
if (z <= -1.3e-69) {
tmp = t_1;
} else if (z <= 3.6e-72) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -2.0 + (x / y) tmp = 0 if z <= -1.3e-69: tmp = t_1 elif z <= 3.6e-72: tmp = 2.0 / (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-2.0 + Float64(x / y)) tmp = 0.0 if (z <= -1.3e-69) tmp = t_1; elseif (z <= 3.6e-72) tmp = Float64(2.0 / Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -2.0 + (x / y); tmp = 0.0; if (z <= -1.3e-69) tmp = t_1; elseif (z <= 3.6e-72) tmp = 2.0 / (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-2.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e-69], t$95$1, If[LessEqual[z, 3.6e-72], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 + \frac{x}{y}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-72}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3000000000000001e-69 or 3.6e-72 < z Initial program 75.8%
Taylor expanded in t around inf
Simplified68.4%
if -1.3000000000000001e-69 < z < 3.6e-72Initial program 97.7%
Taylor expanded in z around 0
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6475.7%
Simplified75.7%
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f6475.7%
Applied egg-rr75.7%
Final simplification71.2%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 1.0) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.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 (t <= (-1.0d0)) then
tmp = -2.0d0
else if (t <= 1.0d0) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.0) {
tmp = -2.0;
} else if (t <= 1.0) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.0: tmp = -2.0 elif t <= 1.0: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.0) tmp = -2.0; elseif (t <= 1.0) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.0) tmp = -2.0; elseif (t <= 1.0) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.0], -2.0, If[LessEqual[t, 1.0], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 1 < t Initial program 71.8%
Simplified99.9%
Taylor expanded in x around 0
Simplified61.8%
Taylor expanded in t around inf
Simplified38.6%
if -1 < t < 1Initial program 98.1%
Taylor expanded in z around inf
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6459.4%
Simplified59.4%
Taylor expanded in t around 0
/-lowering-/.f6433.9%
Simplified33.9%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -2.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 = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 84.2%
Simplified99.1%
Taylor expanded in x around 0
Simplified69.2%
Taylor expanded in t around inf
Simplified21.6%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / 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 = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024161
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))