
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (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) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- y z) (- a z)) t)))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - z)) * t);
}
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) / (a - z)) * t)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) / (a - z)) * t);
}
def code(x, y, z, t, a): return x + (((y - z) / (a - z)) * t)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) / (a - z)) * t); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{a - z} \cdot t
\end{array}
Initial program 84.1%
associate-*l/98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.9e+17) (not (<= y 13000000.0))) (+ x (* t (/ y (- a z)))) (+ x (/ t (- 1.0 (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.9e+17) || !(y <= 13000000.0)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t / (1.0 - (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 ((y <= (-4.9d+17)) .or. (.not. (y <= 13000000.0d0))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (t / (1.0d0 - (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 ((y <= -4.9e+17) || !(y <= 13000000.0)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t / (1.0 - (a / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.9e+17) or not (y <= 13000000.0): tmp = x + (t * (y / (a - z))) else: tmp = x + (t / (1.0 - (a / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.9e+17) || !(y <= 13000000.0)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(t / Float64(1.0 - Float64(a / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.9e+17) || ~((y <= 13000000.0))) tmp = x + (t * (y / (a - z))); else tmp = x + (t / (1.0 - (a / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.9e+17], N[Not[LessEqual[y, 13000000.0]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+17} \lor \neg \left(y \leq 13000000\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\
\end{array}
\end{array}
if y < -4.9e17 or 1.3e7 < y Initial program 81.1%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in y around inf 87.8%
if -4.9e17 < y < 1.3e7Initial program 86.8%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in y around 0 91.3%
neg-mul-191.3%
distribute-neg-frac91.3%
Simplified91.3%
associate-*l/78.2%
frac-2neg78.2%
add-sqr-sqrt38.0%
sqrt-unprod57.5%
sqr-neg57.5%
sqrt-unprod29.6%
add-sqr-sqrt57.2%
distribute-lft-neg-out57.2%
add-sqr-sqrt27.6%
sqrt-unprod55.5%
sqr-neg55.5%
sqrt-unprod40.0%
add-sqr-sqrt78.2%
sub-neg78.2%
distribute-neg-in78.2%
remove-double-neg78.2%
Applied egg-rr78.2%
*-commutative78.2%
associate-/l*91.3%
+-commutative91.3%
unsub-neg91.3%
Simplified91.3%
Taylor expanded in z around 0 91.3%
mul-1-neg91.3%
sub-neg91.3%
Simplified91.3%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.2e+90) (+ x t) (if (<= z 1.3e+81) (+ x (* t (/ y (- a z)))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+90) {
tmp = x + t;
} else if (z <= 1.3e+81) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
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 (z <= (-4.2d+90)) then
tmp = x + t
else if (z <= 1.3d+81) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+90) {
tmp = x + t;
} else if (z <= 1.3e+81) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+90: tmp = x + t elif z <= 1.3e+81: tmp = x + (t * (y / (a - z))) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+90) tmp = Float64(x + t); elseif (z <= 1.3e+81) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.2e+90) tmp = x + t; elseif (z <= 1.3e+81) tmp = x + (t * (y / (a - z))); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+90], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.3e+81], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+90}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+81}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -4.19999999999999961e90 or 1.29999999999999996e81 < z Initial program 69.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.1%
if -4.19999999999999961e90 < z < 1.29999999999999996e81Initial program 93.3%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in y around inf 88.0%
Final simplification85.3%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.92e+18)
(+ x (/ y (/ (- a z) t)))
(if (<= y 2600000.0)
(+ x (/ t (- 1.0 (/ a z))))
(+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.92e+18) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 2600000.0) {
tmp = x + (t / (1.0 - (a / z)));
} else {
tmp = x + (t * (y / (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 (y <= (-1.92d+18)) then
tmp = x + (y / ((a - z) / t))
else if (y <= 2600000.0d0) then
tmp = x + (t / (1.0d0 - (a / z)))
else
tmp = x + (t * (y / (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 (y <= -1.92e+18) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 2600000.0) {
tmp = x + (t / (1.0 - (a / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.92e+18: tmp = x + (y / ((a - z) / t)) elif y <= 2600000.0: tmp = x + (t / (1.0 - (a / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.92e+18) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); elseif (y <= 2600000.0) tmp = Float64(x + Float64(t / Float64(1.0 - Float64(a / z)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.92e+18) tmp = x + (y / ((a - z) / t)); elseif (y <= 2600000.0) tmp = x + (t / (1.0 - (a / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.92e+18], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2600000.0], N[(x + N[(t / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.92 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{elif}\;y \leq 2600000:\\
\;\;\;\;x + \frac{t}{1 - \frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -1.92e18Initial program 74.0%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in y around inf 69.7%
associate-/l*84.9%
Simplified84.9%
if -1.92e18 < y < 2.6e6Initial program 86.8%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in y around 0 91.3%
neg-mul-191.3%
distribute-neg-frac91.3%
Simplified91.3%
associate-*l/78.2%
frac-2neg78.2%
add-sqr-sqrt38.0%
sqrt-unprod57.5%
sqr-neg57.5%
sqrt-unprod29.6%
add-sqr-sqrt57.2%
distribute-lft-neg-out57.2%
add-sqr-sqrt27.6%
sqrt-unprod55.5%
sqr-neg55.5%
sqrt-unprod40.0%
add-sqr-sqrt78.2%
sub-neg78.2%
distribute-neg-in78.2%
remove-double-neg78.2%
Applied egg-rr78.2%
*-commutative78.2%
associate-/l*91.3%
+-commutative91.3%
unsub-neg91.3%
Simplified91.3%
Taylor expanded in z around 0 91.3%
mul-1-neg91.3%
sub-neg91.3%
Simplified91.3%
if 2.6e6 < y Initial program 89.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 94.6%
Final simplification90.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2e+18)
(+ x (/ y (/ (- a z) t)))
(if (<= y 185000000.0)
(- x (* t (/ z (- a z))))
(+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2e+18) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 185000000.0) {
tmp = x - (t * (z / (a - z)));
} else {
tmp = x + (t * (y / (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 (y <= (-2d+18)) then
tmp = x + (y / ((a - z) / t))
else if (y <= 185000000.0d0) then
tmp = x - (t * (z / (a - z)))
else
tmp = x + (t * (y / (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 (y <= -2e+18) {
tmp = x + (y / ((a - z) / t));
} else if (y <= 185000000.0) {
tmp = x - (t * (z / (a - z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2e+18: tmp = x + (y / ((a - z) / t)) elif y <= 185000000.0: tmp = x - (t * (z / (a - z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2e+18) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); elseif (y <= 185000000.0) tmp = Float64(x - Float64(t * Float64(z / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2e+18) tmp = x + (y / ((a - z) / t)); elseif (y <= 185000000.0) tmp = x - (t * (z / (a - z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2e+18], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 185000000.0], N[(x - N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{elif}\;y \leq 185000000:\\
\;\;\;\;x - t \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if y < -2e18Initial program 74.0%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in y around inf 69.7%
associate-/l*84.9%
Simplified84.9%
if -2e18 < y < 1.85e8Initial program 86.8%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in y around 0 91.3%
neg-mul-191.3%
distribute-neg-frac91.3%
Simplified91.3%
if 1.85e8 < y Initial program 89.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 94.6%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+34) (+ x t) (if (<= z 4.6e+81) (+ x (* t (/ y a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+34) {
tmp = x + t;
} else if (z <= 4.6e+81) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
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 (z <= (-1.9d+34)) then
tmp = x + t
else if (z <= 4.6d+81) then
tmp = x + (t * (y / a))
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+34) {
tmp = x + t;
} else if (z <= 4.6e+81) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+34: tmp = x + t elif z <= 4.6e+81: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+34) tmp = Float64(x + t); elseif (z <= 4.6e+81) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e+34) tmp = x + t; elseif (z <= 4.6e+81) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+34], N[(x + t), $MachinePrecision], If[LessEqual[z, 4.6e+81], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+81}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.9000000000000001e34 or 4.5999999999999998e81 < z Initial program 72.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.5%
if -1.9000000000000001e34 < z < 4.5999999999999998e81Initial program 93.3%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around 0 76.2%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.4e-81) (+ x t) (if (<= z 1e-10) x (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e-81) {
tmp = x + t;
} else if (z <= 1e-10) {
tmp = x;
} else {
tmp = x + t;
}
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 (z <= (-3.4d-81)) then
tmp = x + t
else if (z <= 1d-10) then
tmp = x
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e-81) {
tmp = x + t;
} else if (z <= 1e-10) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.4e-81: tmp = x + t elif z <= 1e-10: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.4e-81) tmp = Float64(x + t); elseif (z <= 1e-10) tmp = x; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.4e-81) tmp = x + t; elseif (z <= 1e-10) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.4e-81], N[(x + t), $MachinePrecision], If[LessEqual[z, 1e-10], x, N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-81}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.3999999999999999e-81 or 1.00000000000000004e-10 < z Initial program 76.7%
associate-*l/99.3%
Simplified99.3%
Taylor expanded in z around inf 71.6%
if -3.3999999999999999e-81 < z < 1.00000000000000004e-10Initial program 94.6%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around 0 80.0%
associate-/l*82.3%
Simplified82.3%
Taylor expanded in x around inf 53.3%
Final simplification64.0%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 84.1%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in z around 0 59.3%
associate-/l*61.1%
Simplified61.1%
Taylor expanded in x around inf 49.6%
Final simplification49.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (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 + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (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 + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023171
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))