
(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 11 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 (+ (/ x y) (+ -2.0 (/ (+ 2.0 (/ 2.0 z)) t))))
double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / 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 = (x / y) + ((-2.0d0) + ((2.0d0 + (2.0d0 / z)) / t))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t));
}
def code(x, y, z, t): return (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(-2.0 + Float64(Float64(2.0 + Float64(2.0 / z)) / t))) end
function tmp = code(x, y, z, t) tmp = (x / y) + (-2.0 + ((2.0 + (2.0 / z)) / t)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(-2 + \frac{2 + \frac{2}{z}}{t}\right)
\end{array}
Initial program 90.0%
sub-neg90.0%
distribute-rgt-in90.0%
*-lft-identity90.0%
associate-+r+90.0%
cancel-sign-sub-inv90.0%
div-sub82.2%
associate-*r*82.2%
associate-*l/82.2%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -7.8e+130)
(/ x y)
(if (or (<= (/ x y) -1.35e+78)
(and (not (<= (/ x y) -2.2e+18)) (<= (/ x y) 550000000.0)))
(+ -2.0 (/ 2.0 t))
(/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -7.8e+130) {
tmp = x / y;
} else if (((x / y) <= -1.35e+78) || (!((x / y) <= -2.2e+18) && ((x / y) <= 550000000.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) <= (-7.8d+130)) then
tmp = x / y
else if (((x / y) <= (-1.35d+78)) .or. (.not. ((x / y) <= (-2.2d+18))) .and. ((x / y) <= 550000000.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) <= -7.8e+130) {
tmp = x / y;
} else if (((x / y) <= -1.35e+78) || (!((x / y) <= -2.2e+18) && ((x / y) <= 550000000.0))) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -7.8e+130: tmp = x / y elif ((x / y) <= -1.35e+78) or (not ((x / y) <= -2.2e+18) and ((x / y) <= 550000000.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) <= -7.8e+130) tmp = Float64(x / y); elseif ((Float64(x / y) <= -1.35e+78) || (!(Float64(x / y) <= -2.2e+18) && (Float64(x / y) <= 550000000.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) <= -7.8e+130) tmp = x / y; elseif (((x / y) <= -1.35e+78) || (~(((x / y) <= -2.2e+18)) && ((x / y) <= 550000000.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], -7.8e+130], N[(x / y), $MachinePrecision], If[Or[LessEqual[N[(x / y), $MachinePrecision], -1.35e+78], And[N[Not[LessEqual[N[(x / y), $MachinePrecision], -2.2e+18]], $MachinePrecision], LessEqual[N[(x / y), $MachinePrecision], 550000000.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 -7.8 \cdot 10^{+130}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.35 \cdot 10^{+78} \lor \neg \left(\frac{x}{y} \leq -2.2 \cdot 10^{+18}\right) \land \frac{x}{y} \leq 550000000:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -7.8000000000000004e130 or -1.35000000000000002e78 < (/.f64 x y) < -2.2e18 or 5.5e8 < (/.f64 x y) Initial program 93.1%
sub-neg93.1%
distribute-rgt-in93.1%
*-lft-identity93.1%
associate-+r+93.1%
cancel-sign-sub-inv93.1%
div-sub87.2%
associate-*r*87.2%
associate-*l/87.2%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around inf 69.8%
if -7.8000000000000004e130 < (/.f64 x y) < -1.35000000000000002e78 or -2.2e18 < (/.f64 x y) < 5.5e8Initial program 87.4%
sub-neg87.4%
distribute-rgt-in87.4%
*-lft-identity87.4%
associate-+r+87.4%
cancel-sign-sub-inv87.4%
div-sub78.0%
associate-*r*78.0%
associate-*l/78.0%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/99.2%
Simplified99.2%
Taylor expanded in x around 0 97.2%
+-commutative97.2%
associate--l+97.2%
associate-*r/97.2%
metadata-eval97.2%
sub-neg97.2%
associate-*r/97.2%
metadata-eval97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in z around inf 62.1%
sub-neg62.1%
associate-*r/62.1%
metadata-eval62.1%
metadata-eval62.1%
+-commutative62.1%
Simplified62.1%
Final simplification65.7%
(FPCore (x y z t)
:precision binary64
(if (<= (/ x y) -7.8e+130)
(/ x y)
(if (<= (/ x y) -1.4e+78)
(/ 2.0 t)
(if (<= (/ x y) -480000000.0)
(/ x y)
(if (<= (/ x y) 2.0) -2.0 (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -7.8e+130) {
tmp = x / y;
} else if ((x / y) <= -1.4e+78) {
tmp = 2.0 / t;
} else if ((x / y) <= -480000000.0) {
tmp = x / y;
} 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) <= (-7.8d+130)) then
tmp = x / y
else if ((x / y) <= (-1.4d+78)) then
tmp = 2.0d0 / t
else if ((x / y) <= (-480000000.0d0)) then
tmp = x / y
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) <= -7.8e+130) {
tmp = x / y;
} else if ((x / y) <= -1.4e+78) {
tmp = 2.0 / t;
} else if ((x / y) <= -480000000.0) {
tmp = x / y;
} 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) <= -7.8e+130: tmp = x / y elif (x / y) <= -1.4e+78: tmp = 2.0 / t elif (x / y) <= -480000000.0: tmp = x / y 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) <= -7.8e+130) tmp = Float64(x / y); elseif (Float64(x / y) <= -1.4e+78) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= -480000000.0) tmp = Float64(x / y); 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) <= -7.8e+130) tmp = x / y; elseif ((x / y) <= -1.4e+78) tmp = 2.0 / t; elseif ((x / y) <= -480000000.0) tmp = x / y; 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], -7.8e+130], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -1.4e+78], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -480000000.0], N[(x / y), $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 -7.8 \cdot 10^{+130}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -1.4 \cdot 10^{+78}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq -480000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 2:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -7.8000000000000004e130 or -1.4000000000000001e78 < (/.f64 x y) < -4.8e8 or 2 < (/.f64 x y) Initial program 93.5%
sub-neg93.5%
distribute-rgt-in93.5%
*-lft-identity93.5%
associate-+r+93.5%
cancel-sign-sub-inv93.5%
div-sub87.9%
associate-*r*87.9%
associate-*l/87.9%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.1%
Simplified99.1%
Taylor expanded in x around inf 65.9%
if -7.8000000000000004e130 < (/.f64 x y) < -1.4000000000000001e78Initial program 91.7%
+-commutative91.7%
frac-add77.2%
+-commutative77.2%
associate-*l*77.2%
fma-def77.2%
*-commutative77.2%
*-commutative77.2%
Applied egg-rr77.2%
Taylor expanded in t around 0 83.5%
Taylor expanded in z around inf 55.7%
if -4.8e8 < (/.f64 x y) < 2Initial program 86.1%
sub-neg86.1%
distribute-rgt-in86.1%
*-lft-identity86.1%
associate-+r+86.1%
cancel-sign-sub-inv86.1%
div-sub76.7%
associate-*r*76.7%
associate-*l/76.7%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.5%
+-commutative99.5%
associate--l+99.5%
associate-*r/99.5%
metadata-eval99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 41.2%
Final simplification54.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.6e-7) (not (<= t 1.35e-49))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.6e-7) || !(t <= 1.35e-49)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 + (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 ((t <= (-8.6d-7)) .or. (.not. (t <= 1.35d-49))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
else
tmp = (2.0d0 + (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 ((t <= -8.6e-7) || !(t <= 1.35e-49)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.6e-7) or not (t <= 1.35e-49): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.6e-7) || !(t <= 1.35e-49)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.6e-7) || ~((t <= 1.35e-49))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.6e-7], N[Not[LessEqual[t, 1.35e-49]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{-7} \lor \neg \left(t \leq 1.35 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -8.6000000000000002e-7 or 1.35e-49 < t Initial program 83.4%
sub-neg83.4%
distribute-rgt-in83.4%
*-lft-identity83.4%
associate-+r+83.4%
cancel-sign-sub-inv83.4%
div-sub83.4%
associate-*r*83.4%
associate-*l/83.4%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.3%
Simplified99.3%
Taylor expanded in z around inf 82.6%
associate--l+82.6%
sub-neg82.6%
associate-*r/82.6%
metadata-eval82.6%
metadata-eval82.6%
Simplified82.6%
if -8.6000000000000002e-7 < t < 1.35e-49Initial program 99.6%
sub-neg99.6%
distribute-rgt-in99.6%
*-lft-identity99.6%
associate-+r+99.6%
cancel-sign-sub-inv99.6%
div-sub80.4%
associate-*r*80.4%
associate-*l/80.4%
*-inverses99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
metadata-eval99.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 84.2%
+-commutative84.2%
associate--l+84.2%
associate-*r/84.2%
metadata-eval84.2%
sub-neg84.2%
associate-*r/84.2%
metadata-eval84.2%
metadata-eval84.2%
Simplified84.2%
Taylor expanded in t around 0 84.3%
associate-*r/84.3%
metadata-eval84.3%
Simplified84.3%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.8e-41) (not (<= z 2.9e-32))) (+ (/ x y) (+ -2.0 (/ 2.0 t))) (+ (/ x y) (/ 2.0 (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.8e-41) || !(z <= 2.9e-32)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} 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 ((z <= (-7.8d-41)) .or. (.not. (z <= 2.9d-32))) then
tmp = (x / y) + ((-2.0d0) + (2.0d0 / t))
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 ((z <= -7.8e-41) || !(z <= 2.9e-32)) {
tmp = (x / y) + (-2.0 + (2.0 / t));
} else {
tmp = (x / y) + (2.0 / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.8e-41) or not (z <= 2.9e-32): tmp = (x / y) + (-2.0 + (2.0 / t)) else: tmp = (x / y) + (2.0 / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.8e-41) || !(z <= 2.9e-32)) tmp = Float64(Float64(x / y) + Float64(-2.0 + Float64(2.0 / t))); 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 ((z <= -7.8e-41) || ~((z <= 2.9e-32))) tmp = (x / y) + (-2.0 + (2.0 / t)); else tmp = (x / y) + (2.0 / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.8e-41], N[Not[LessEqual[z, 2.9e-32]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-41} \lor \neg \left(z \leq 2.9 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x}{y} + \left(-2 + \frac{2}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{z \cdot t}\\
\end{array}
\end{array}
if z < -7.79999999999999982e-41 or 2.89999999999999996e-32 < z Initial program 81.3%
sub-neg81.3%
distribute-rgt-in81.3%
*-lft-identity81.3%
associate-+r+81.3%
cancel-sign-sub-inv81.3%
div-sub81.3%
associate-*r*81.3%
associate-*l/81.3%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 96.6%
associate--l+96.6%
sub-neg96.6%
associate-*r/96.6%
metadata-eval96.6%
metadata-eval96.6%
Simplified96.6%
if -7.79999999999999982e-41 < z < 2.89999999999999996e-32Initial program 99.8%
Taylor expanded in z around 0 88.1%
Final simplification92.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -6.4e-41)
t_1
(if (<= z 2.5e-174)
(/ 2.0 (* z t))
(if (<= z 1.55e+75) t_1 (+ -2.0 (/ 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -6.4e-41) {
tmp = t_1;
} else if (z <= 2.5e-174) {
tmp = 2.0 / (z * t);
} else if (z <= 1.55e+75) {
tmp = t_1;
} else {
tmp = -2.0 + (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 = (x / y) - 2.0d0
if (z <= (-6.4d-41)) then
tmp = t_1
else if (z <= 2.5d-174) then
tmp = 2.0d0 / (z * t)
else if (z <= 1.55d+75) then
tmp = t_1
else
tmp = (-2.0d0) + (2.0d0 / t)
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;
double tmp;
if (z <= -6.4e-41) {
tmp = t_1;
} else if (z <= 2.5e-174) {
tmp = 2.0 / (z * t);
} else if (z <= 1.55e+75) {
tmp = t_1;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -6.4e-41: tmp = t_1 elif z <= 2.5e-174: tmp = 2.0 / (z * t) elif z <= 1.55e+75: tmp = t_1 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -6.4e-41) tmp = t_1; elseif (z <= 2.5e-174) tmp = Float64(2.0 / Float64(z * t)); elseif (z <= 1.55e+75) tmp = t_1; else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -6.4e-41) tmp = t_1; elseif (z <= 2.5e-174) tmp = 2.0 / (z * t); elseif (z <= 1.55e+75) tmp = t_1; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -6.4e-41], t$95$1, If[LessEqual[z, 2.5e-174], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+75], t$95$1, N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-174}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+75}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if z < -6.40000000000000024e-41 or 2.5000000000000001e-174 < z < 1.5500000000000001e75Initial program 89.2%
sub-neg89.2%
distribute-rgt-in89.2%
*-lft-identity89.2%
associate-+r+89.2%
cancel-sign-sub-inv89.2%
div-sub87.8%
associate-*r*87.8%
associate-*l/87.8%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified100.0%
Taylor expanded in t around inf 64.6%
if -6.40000000000000024e-41 < z < 2.5000000000000001e-174Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
times-frac99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in x around 0 78.5%
Taylor expanded in z around 0 67.0%
un-div-inv67.0%
*-commutative67.0%
Applied egg-rr67.0%
if 1.5500000000000001e75 < z Initial program 69.4%
sub-neg69.4%
distribute-rgt-in69.4%
*-lft-identity69.4%
associate-+r+69.4%
cancel-sign-sub-inv69.4%
div-sub69.4%
associate-*r*69.4%
associate-*l/69.4%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 75.8%
+-commutative75.8%
associate--l+75.8%
associate-*r/75.8%
metadata-eval75.8%
sub-neg75.8%
associate-*r/75.8%
metadata-eval75.8%
metadata-eval75.8%
Simplified75.8%
Taylor expanded in z around inf 75.8%
sub-neg75.8%
associate-*r/75.8%
metadata-eval75.8%
metadata-eval75.8%
+-commutative75.8%
Simplified75.8%
Final simplification66.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= z -4.8e-41)
t_1
(if (<= z 1.45e-176)
(/ (/ 2.0 t) z)
(if (<= z 1.2e+73) t_1 (+ -2.0 (/ 2.0 t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (z <= -4.8e-41) {
tmp = t_1;
} else if (z <= 1.45e-176) {
tmp = (2.0 / t) / z;
} else if (z <= 1.2e+73) {
tmp = t_1;
} else {
tmp = -2.0 + (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 = (x / y) - 2.0d0
if (z <= (-4.8d-41)) then
tmp = t_1
else if (z <= 1.45d-176) then
tmp = (2.0d0 / t) / z
else if (z <= 1.2d+73) then
tmp = t_1
else
tmp = (-2.0d0) + (2.0d0 / t)
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;
double tmp;
if (z <= -4.8e-41) {
tmp = t_1;
} else if (z <= 1.45e-176) {
tmp = (2.0 / t) / z;
} else if (z <= 1.2e+73) {
tmp = t_1;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if z <= -4.8e-41: tmp = t_1 elif z <= 1.45e-176: tmp = (2.0 / t) / z elif z <= 1.2e+73: tmp = t_1 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (z <= -4.8e-41) tmp = t_1; elseif (z <= 1.45e-176) tmp = Float64(Float64(2.0 / t) / z); elseif (z <= 1.2e+73) tmp = t_1; else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (z <= -4.8e-41) tmp = t_1; elseif (z <= 1.45e-176) tmp = (2.0 / t) / z; elseif (z <= 1.2e+73) tmp = t_1; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[z, -4.8e-41], t$95$1, If[LessEqual[z, 1.45e-176], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.2e+73], t$95$1, N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-176}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if z < -4.80000000000000044e-41 or 1.45000000000000003e-176 < z < 1.20000000000000001e73Initial program 89.2%
sub-neg89.2%
distribute-rgt-in89.2%
*-lft-identity89.2%
associate-+r+89.2%
cancel-sign-sub-inv89.2%
div-sub87.8%
associate-*r*87.8%
associate-*l/87.8%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.9%
Simplified100.0%
Taylor expanded in t around inf 64.6%
if -4.80000000000000044e-41 < z < 1.45000000000000003e-176Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
associate-*r*99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
times-frac99.6%
fma-def99.6%
*-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in x around 0 78.5%
Taylor expanded in z around 0 67.0%
expm1-log1p-u30.6%
expm1-udef30.6%
*-commutative30.6%
Applied egg-rr30.6%
expm1-def30.6%
expm1-log1p67.0%
*-commutative67.0%
associate-/r*67.0%
Simplified67.0%
associate-*r/67.0%
div-inv67.0%
Applied egg-rr67.0%
if 1.20000000000000001e73 < z Initial program 69.4%
sub-neg69.4%
distribute-rgt-in69.4%
*-lft-identity69.4%
associate-+r+69.4%
cancel-sign-sub-inv69.4%
div-sub69.4%
associate-*r*69.4%
associate-*l/69.4%
*-inverses99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in x around 0 75.8%
+-commutative75.8%
associate--l+75.8%
associate-*r/75.8%
metadata-eval75.8%
sub-neg75.8%
associate-*r/75.8%
metadata-eval75.8%
metadata-eval75.8%
Simplified75.8%
Taylor expanded in z around inf 75.8%
sub-neg75.8%
associate-*r/75.8%
metadata-eval75.8%
metadata-eval75.8%
+-commutative75.8%
Simplified75.8%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.5e-7) (not (<= t 6.2e+78))) (- (/ x y) 2.0) (/ (+ 2.0 (/ 2.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.5e-7) || !(t <= 6.2e+78)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (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 ((t <= (-8.5d-7)) .or. (.not. (t <= 6.2d+78))) then
tmp = (x / y) - 2.0d0
else
tmp = (2.0d0 + (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 ((t <= -8.5e-7) || !(t <= 6.2e+78)) {
tmp = (x / y) - 2.0;
} else {
tmp = (2.0 + (2.0 / z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.5e-7) or not (t <= 6.2e+78): tmp = (x / y) - 2.0 else: tmp = (2.0 + (2.0 / z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.5e-7) || !(t <= 6.2e+78)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.5e-7) || ~((t <= 6.2e+78))) tmp = (x / y) - 2.0; else tmp = (2.0 + (2.0 / z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.5e-7], N[Not[LessEqual[t, 6.2e+78]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-7} \lor \neg \left(t \leq 6.2 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\end{array}
\end{array}
if t < -8.50000000000000014e-7 or 6.2e78 < t Initial program 81.7%
sub-neg81.7%
distribute-rgt-in81.7%
*-lft-identity81.7%
associate-+r+81.7%
cancel-sign-sub-inv81.7%
div-sub81.7%
associate-*r*81.7%
associate-*l/81.7%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.2%
Simplified99.2%
Taylor expanded in t around inf 86.3%
if -8.50000000000000014e-7 < t < 6.2e78Initial program 98.1%
sub-neg98.1%
distribute-rgt-in98.1%
*-lft-identity98.1%
associate-+r+98.1%
cancel-sign-sub-inv98.1%
div-sub82.7%
associate-*r*82.7%
associate-*l/82.7%
*-inverses99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
metadata-eval99.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 81.1%
+-commutative81.1%
associate--l+81.1%
associate-*r/81.1%
metadata-eval81.1%
sub-neg81.1%
associate-*r/81.1%
metadata-eval81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in t around 0 79.3%
associate-*r/79.3%
metadata-eval79.3%
Simplified79.3%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.95e-138) (not (<= t 9e-11))) (- (/ x y) 2.0) (+ -2.0 (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.95e-138) || !(t <= 9e-11)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + (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) :: tmp
if ((t <= (-1.95d-138)) .or. (.not. (t <= 9d-11))) then
tmp = (x / y) - 2.0d0
else
tmp = (-2.0d0) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.95e-138) || !(t <= 9e-11)) {
tmp = (x / y) - 2.0;
} else {
tmp = -2.0 + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.95e-138) or not (t <= 9e-11): tmp = (x / y) - 2.0 else: tmp = -2.0 + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.95e-138) || !(t <= 9e-11)) tmp = Float64(Float64(x / y) - 2.0); else tmp = Float64(-2.0 + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.95e-138) || ~((t <= 9e-11))) tmp = (x / y) - 2.0; else tmp = -2.0 + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.95e-138], N[Not[LessEqual[t, 9e-11]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-138} \lor \neg \left(t \leq 9 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{x}{y} - 2\\
\mathbf{else}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\end{array}
\end{array}
if t < -1.95e-138 or 8.9999999999999999e-11 < t Initial program 84.6%
sub-neg84.6%
distribute-rgt-in84.6%
*-lft-identity84.6%
associate-+r+84.6%
cancel-sign-sub-inv84.6%
div-sub82.2%
associate-*r*82.2%
associate-*l/82.2%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.3%
Simplified99.3%
Taylor expanded in t around inf 73.9%
if -1.95e-138 < t < 8.9999999999999999e-11Initial program 99.6%
sub-neg99.6%
distribute-rgt-in99.6%
*-lft-identity99.6%
associate-+r+99.6%
cancel-sign-sub-inv99.6%
div-sub82.3%
associate-*r*82.3%
associate-*l/82.3%
*-inverses99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
metadata-eval99.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 86.3%
+-commutative86.3%
associate--l+86.3%
associate-*r/86.3%
metadata-eval86.3%
sub-neg86.3%
associate-*r/86.3%
metadata-eval86.3%
metadata-eval86.3%
Simplified86.3%
Taylor expanded in z around inf 47.1%
sub-neg47.1%
associate-*r/47.1%
metadata-eval47.1%
metadata-eval47.1%
+-commutative47.1%
Simplified47.1%
Final simplification64.3%
(FPCore (x y z t) :precision binary64 (if (<= t -1.0) -2.0 (if (<= t 2.85e-5) (/ 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 <= 2.85e-5) {
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 <= 2.85d-5) 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 <= 2.85e-5) {
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 <= 2.85e-5: 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 <= 2.85e-5) 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 <= 2.85e-5) 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, 2.85e-5], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 2.85 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1 or 2.8500000000000002e-5 < t Initial program 81.8%
sub-neg81.8%
distribute-rgt-in81.8%
*-lft-identity81.8%
associate-+r+81.8%
cancel-sign-sub-inv81.8%
div-sub81.8%
associate-*r*81.8%
associate-*l/81.8%
*-inverses99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
metadata-eval99.9%
associate-/l/99.2%
Simplified99.2%
Taylor expanded in x around 0 53.0%
+-commutative53.0%
associate--l+53.0%
associate-*r/53.0%
metadata-eval53.0%
sub-neg53.0%
associate-*r/53.0%
metadata-eval53.0%
metadata-eval53.0%
Simplified53.0%
Taylor expanded in t around inf 35.8%
if -1 < t < 2.8500000000000002e-5Initial program 99.6%
+-commutative99.6%
frac-add80.5%
+-commutative80.5%
associate-*l*80.5%
fma-def80.5%
*-commutative80.5%
*-commutative80.5%
Applied egg-rr80.5%
Taylor expanded in t around 0 80.9%
Taylor expanded in z around inf 39.2%
Final simplification37.4%
(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 90.0%
sub-neg90.0%
distribute-rgt-in90.0%
*-lft-identity90.0%
associate-+r+90.0%
cancel-sign-sub-inv90.0%
div-sub82.2%
associate-*r*82.2%
associate-*l/82.2%
*-inverses99.8%
metadata-eval99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
metadata-eval99.8%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in x around 0 66.3%
+-commutative66.3%
associate--l+66.3%
associate-*r/66.3%
metadata-eval66.3%
sub-neg66.3%
associate-*r/66.3%
metadata-eval66.3%
metadata-eval66.3%
Simplified66.3%
Taylor expanded in t around inf 20.4%
Final simplification20.4%
(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 2023196
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))