
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * (t - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -3e+190)
t_1
(if (<= z 3.8e+211) (+ x (/ (* (- y z) (- t x)) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -3e+190) {
tmp = t_1;
} else if (z <= 3.8e+211) {
tmp = x + (((y - z) * (t - x)) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t - x)
if (z <= (-3d+190)) then
tmp = t_1
else if (z <= 3.8d+211) then
tmp = x + (((y - z) * (t - x)) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -3e+190) {
tmp = t_1;
} else if (z <= 3.8e+211) {
tmp = x + (((y - z) * (t - x)) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -3e+190: tmp = t_1 elif z <= 3.8e+211: tmp = x + (((y - z) * (t - x)) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -3e+190) tmp = t_1; elseif (z <= 3.8e+211) tmp = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -3e+190) tmp = t_1; elseif (z <= 3.8e+211) tmp = x + (((y - z) * (t - x)) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+190], t$95$1, If[LessEqual[z, 3.8e+211], N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+190}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+211}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.99999999999999982e190 or 3.80000000000000016e211 < z Initial program 19.8%
Taylor expanded in x around 0
Applied rewrites2.9%
Taylor expanded in x around 0
Applied rewrites4.3%
Taylor expanded in x around -inf
Applied rewrites50.8%
if -2.99999999999999982e190 < z < 3.80000000000000016e211Initial program 74.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (- y z) (- a z)))))
(if (<= a -9.5e+72)
t_1
(if (<= a 5.2e-43)
(+ x (- t x))
(if (<= a 5e+94) (+ x (* (- y z) (- t x))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) / (a - z));
double tmp;
if (a <= -9.5e+72) {
tmp = t_1;
} else if (a <= 5.2e-43) {
tmp = x + (t - x);
} else if (a <= 5e+94) {
tmp = x + ((y - z) * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) / (a - z))
if (a <= (-9.5d+72)) then
tmp = t_1
else if (a <= 5.2d-43) then
tmp = x + (t - x)
else if (a <= 5d+94) then
tmp = x + ((y - z) * (t - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) / (a - z));
double tmp;
if (a <= -9.5e+72) {
tmp = t_1;
} else if (a <= 5.2e-43) {
tmp = x + (t - x);
} else if (a <= 5e+94) {
tmp = x + ((y - z) * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) / (a - z)) tmp = 0 if a <= -9.5e+72: tmp = t_1 elif a <= 5.2e-43: tmp = x + (t - x) elif a <= 5e+94: tmp = x + ((y - z) * (t - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) / Float64(a - z))) tmp = 0.0 if (a <= -9.5e+72) tmp = t_1; elseif (a <= 5.2e-43) tmp = Float64(x + Float64(t - x)); elseif (a <= 5e+94) tmp = Float64(x + Float64(Float64(y - z) * Float64(t - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) / (a - z)); tmp = 0.0; if (a <= -9.5e+72) tmp = t_1; elseif (a <= 5.2e-43) tmp = x + (t - x); elseif (a <= 5e+94) tmp = x + ((y - z) * (t - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.5e+72], t$95$1, If[LessEqual[a, 5.2e-43], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e+94], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z}\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-43}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+94}:\\
\;\;\;\;x + \left(y - z\right) \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -9.50000000000000054e72 or 5.0000000000000001e94 < a Initial program 68.3%
Taylor expanded in x around 0
Applied rewrites41.6%
if -9.50000000000000054e72 < a < 5.2e-43Initial program 62.1%
Taylor expanded in x around 0
Applied rewrites9.6%
Taylor expanded in x around 0
Applied rewrites13.7%
Taylor expanded in x around -inf
Applied rewrites28.7%
if 5.2e-43 < a < 5.0000000000000001e94Initial program 67.8%
Taylor expanded in x around 0
Applied rewrites37.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.8e+133)
(+ x (- y z))
(if (<= a 5.2e-43)
(+ x (- t x))
(if (<= a 2.7e+113)
(+ x (* (- y z) (- t x)))
(+ x (/ (- a z) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e+133) {
tmp = x + (y - z);
} else if (a <= 5.2e-43) {
tmp = x + (t - x);
} else if (a <= 2.7e+113) {
tmp = x + ((y - z) * (t - x));
} else {
tmp = x + ((a - z) / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.8d+133)) then
tmp = x + (y - z)
else if (a <= 5.2d-43) then
tmp = x + (t - x)
else if (a <= 2.7d+113) then
tmp = x + ((y - z) * (t - x))
else
tmp = x + ((a - z) / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e+133) {
tmp = x + (y - z);
} else if (a <= 5.2e-43) {
tmp = x + (t - x);
} else if (a <= 2.7e+113) {
tmp = x + ((y - z) * (t - x));
} else {
tmp = x + ((a - z) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e+133: tmp = x + (y - z) elif a <= 5.2e-43: tmp = x + (t - x) elif a <= 2.7e+113: tmp = x + ((y - z) * (t - x)) else: tmp = x + ((a - z) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e+133) tmp = Float64(x + Float64(y - z)); elseif (a <= 5.2e-43) tmp = Float64(x + Float64(t - x)); elseif (a <= 2.7e+113) tmp = Float64(x + Float64(Float64(y - z) * Float64(t - x))); else tmp = Float64(x + Float64(Float64(a - z) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e+133) tmp = x + (y - z); elseif (a <= 5.2e-43) tmp = x + (t - x); elseif (a <= 2.7e+113) tmp = x + ((y - z) * (t - x)); else tmp = x + ((a - z) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e+133], N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e-43], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e+113], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+133}:\\
\;\;\;\;x + \left(y - z\right)\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-43}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+113}:\\
\;\;\;\;x + \left(y - z\right) \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a - z}{a - z}\\
\end{array}
\end{array}
if a < -1.79999999999999989e133Initial program 75.1%
Taylor expanded in x around 0
Applied rewrites22.8%
Taylor expanded in x around 0
Applied rewrites48.4%
if -1.79999999999999989e133 < a < 5.2e-43Initial program 61.2%
Taylor expanded in x around 0
Applied rewrites10.5%
Taylor expanded in x around 0
Applied rewrites14.6%
Taylor expanded in x around -inf
Applied rewrites28.6%
if 5.2e-43 < a < 2.70000000000000011e113Initial program 68.7%
Taylor expanded in x around 0
Applied rewrites36.1%
if 2.70000000000000011e113 < a Initial program 67.6%
Taylor expanded in x around 0
Applied rewrites26.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -1.15e+184)
t_1
(if (<= z 3.8e+211) (/ (* (- y z) (- t x)) (- a z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -1.15e+184) {
tmp = t_1;
} else if (z <= 3.8e+211) {
tmp = ((y - z) * (t - x)) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t - x)
if (z <= (-1.15d+184)) then
tmp = t_1
else if (z <= 3.8d+211) then
tmp = ((y - z) * (t - x)) / (a - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -1.15e+184) {
tmp = t_1;
} else if (z <= 3.8e+211) {
tmp = ((y - z) * (t - x)) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -1.15e+184: tmp = t_1 elif z <= 3.8e+211: tmp = ((y - z) * (t - x)) / (a - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -1.15e+184) tmp = t_1; elseif (z <= 3.8e+211) tmp = Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -1.15e+184) tmp = t_1; elseif (z <= 3.8e+211) tmp = ((y - z) * (t - x)) / (a - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+184], t$95$1, If[LessEqual[z, 3.8e+211], N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+211}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15e184 or 3.80000000000000016e211 < z Initial program 21.6%
Taylor expanded in x around 0
Applied rewrites2.9%
Taylor expanded in x around 0
Applied rewrites4.3%
Taylor expanded in x around -inf
Applied rewrites51.9%
if -1.15e184 < z < 3.80000000000000016e211Initial program 74.4%
Taylor expanded in x around 0
Applied rewrites51.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- y z))))
(if (<= a -1.8e+133)
t_1
(if (<= a 5.2e-43)
(+ x (- t x))
(if (<= a 7e+94) (+ x (* (- y z) (- t x))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - z);
double tmp;
if (a <= -1.8e+133) {
tmp = t_1;
} else if (a <= 5.2e-43) {
tmp = x + (t - x);
} else if (a <= 7e+94) {
tmp = x + ((y - z) * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y - z)
if (a <= (-1.8d+133)) then
tmp = t_1
else if (a <= 5.2d-43) then
tmp = x + (t - x)
else if (a <= 7d+94) then
tmp = x + ((y - z) * (t - x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - z);
double tmp;
if (a <= -1.8e+133) {
tmp = t_1;
} else if (a <= 5.2e-43) {
tmp = x + (t - x);
} else if (a <= 7e+94) {
tmp = x + ((y - z) * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - z) tmp = 0 if a <= -1.8e+133: tmp = t_1 elif a <= 5.2e-43: tmp = x + (t - x) elif a <= 7e+94: tmp = x + ((y - z) * (t - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - z)) tmp = 0.0 if (a <= -1.8e+133) tmp = t_1; elseif (a <= 5.2e-43) tmp = Float64(x + Float64(t - x)); elseif (a <= 7e+94) tmp = Float64(x + Float64(Float64(y - z) * Float64(t - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - z); tmp = 0.0; if (a <= -1.8e+133) tmp = t_1; elseif (a <= 5.2e-43) tmp = x + (t - x); elseif (a <= 7e+94) tmp = x + ((y - z) * (t - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.8e+133], t$95$1, If[LessEqual[a, 5.2e-43], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+94], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right)\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-43}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+94}:\\
\;\;\;\;x + \left(y - z\right) \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.79999999999999989e133 or 6.9999999999999994e94 < a Initial program 71.4%
Taylor expanded in x around 0
Applied rewrites17.5%
Taylor expanded in x around 0
Applied rewrites35.8%
if -1.79999999999999989e133 < a < 5.2e-43Initial program 61.2%
Taylor expanded in x around 0
Applied rewrites10.5%
Taylor expanded in x around 0
Applied rewrites14.6%
Taylor expanded in x around -inf
Applied rewrites28.6%
if 5.2e-43 < a < 6.9999999999999994e94Initial program 67.8%
Taylor expanded in x around 0
Applied rewrites37.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (- y z)))) (if (<= a -1.8e+133) t_1 (if (<= a 9.5e-36) (+ x (- t x)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - z);
double tmp;
if (a <= -1.8e+133) {
tmp = t_1;
} else if (a <= 9.5e-36) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y - z)
if (a <= (-1.8d+133)) then
tmp = t_1
else if (a <= 9.5d-36) then
tmp = x + (t - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y - z);
double tmp;
if (a <= -1.8e+133) {
tmp = t_1;
} else if (a <= 9.5e-36) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y - z) tmp = 0 if a <= -1.8e+133: tmp = t_1 elif a <= 9.5e-36: tmp = x + (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y - z)) tmp = 0.0 if (a <= -1.8e+133) tmp = t_1; elseif (a <= 9.5e-36) tmp = Float64(x + Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y - z); tmp = 0.0; if (a <= -1.8e+133) tmp = t_1; elseif (a <= 9.5e-36) tmp = x + (t - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.8e+133], t$95$1, If[LessEqual[a, 9.5e-36], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right)\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-36}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.79999999999999989e133 or 9.5000000000000003e-36 < a Initial program 70.3%
Taylor expanded in x around 0
Applied rewrites23.9%
Taylor expanded in x around 0
Applied rewrites29.4%
if -1.79999999999999989e133 < a < 9.5000000000000003e-36Initial program 61.2%
Taylor expanded in x around 0
Applied rewrites10.5%
Taylor expanded in x around 0
Applied rewrites14.6%
Taylor expanded in x around -inf
Applied rewrites28.6%
(FPCore (x y z t a) :precision binary64 (+ x (- y z)))
double code(double x, double y, double z, double t, double a) {
return x + (y - z);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y - z)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y - z);
}
def code(x, y, z, t, a): return x + (y - z)
function code(x, y, z, t, a) return Float64(x + Float64(y - z)) end
function tmp = code(x, y, z, t, a) tmp = x + (y - z); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right)
\end{array}
Initial program 65.1%
Taylor expanded in x around 0
Applied rewrites16.3%
Taylor expanded in x around 0
Applied rewrites16.7%
(FPCore (x y z t a) :precision binary64 (+ x (- a z)))
double code(double x, double y, double z, double t, double a) {
return x + (a - z);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (a - z)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a - z);
}
def code(x, y, z, t, a): return x + (a - z)
function code(x, y, z, t, a) return Float64(x + Float64(a - z)) end
function tmp = code(x, y, z, t, a) tmp = x + (a - z); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(a - z\right)
\end{array}
Initial program 65.1%
Taylor expanded in x around 0
Applied rewrites16.3%
Taylor expanded in x around 0
Applied rewrites18.2%
Taylor expanded in x around 0
Applied rewrites8.4%
(FPCore (x y z t a) :precision binary64 (- a z))
double code(double x, double y, double z, double t, double a) {
return a - z;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = a - z
end function
public static double code(double x, double y, double z, double t, double a) {
return a - z;
}
def code(x, y, z, t, a): return a - z
function code(x, y, z, t, a) return Float64(a - z) end
function tmp = code(x, y, z, t, a) tmp = a - z; end
code[x_, y_, z_, t_, a_] := N[(a - z), $MachinePrecision]
\begin{array}{l}
\\
a - z
\end{array}
Initial program 65.1%
Taylor expanded in x around 0
Applied rewrites45.7%
Taylor expanded in x around inf
Applied rewrites3.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - x)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024313
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))