
(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 11 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 (* t (/ (- y z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (t * ((y - z) / (z - a)));
}
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 - (t * ((y - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (t * ((y - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (t * ((y - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(t * Float64(Float64(y - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (t * ((y - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(t * N[(N[(y - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - t \cdot \frac{y - z}{z - a}
\end{array}
Initial program 86.7%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around 0 85.9%
associate-*r/85.9%
mul-1-neg85.9%
distribute-rgt-neg-out85.9%
associate-*l/86.5%
associate-*l/93.1%
distribute-lft-out95.0%
+-commutative95.0%
sub-neg95.0%
associate-*l/86.7%
associate-*r/98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+169)
(+ x t)
(if (<= z 5.5e-55)
(+ x (* t (/ y a)))
(if (<= z 8.8e+73) (- x (/ t (/ z y))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+169) {
tmp = x + t;
} else if (z <= 5.5e-55) {
tmp = x + (t * (y / a));
} else if (z <= 8.8e+73) {
tmp = x - (t / (z / y));
} 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 <= (-6.6d+169)) then
tmp = x + t
else if (z <= 5.5d-55) then
tmp = x + (t * (y / a))
else if (z <= 8.8d+73) then
tmp = x - (t / (z / y))
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 <= -6.6e+169) {
tmp = x + t;
} else if (z <= 5.5e-55) {
tmp = x + (t * (y / a));
} else if (z <= 8.8e+73) {
tmp = x - (t / (z / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+169: tmp = x + t elif z <= 5.5e-55: tmp = x + (t * (y / a)) elif z <= 8.8e+73: tmp = x - (t / (z / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+169) tmp = Float64(x + t); elseif (z <= 5.5e-55) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 8.8e+73) tmp = Float64(x - Float64(t / Float64(z / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.6e+169) tmp = x + t; elseif (z <= 5.5e-55) tmp = x + (t * (y / a)); elseif (z <= 8.8e+73) tmp = x - (t / (z / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+169], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.5e-55], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+73], N[(x - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+169}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-55}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+73}:\\
\;\;\;\;x - \frac{t}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.5999999999999994e169 or 8.8e73 < z Initial program 72.2%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 81.0%
if -6.5999999999999994e169 < z < 5.4999999999999999e-55Initial program 92.8%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around inf 83.3%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in a around inf 70.5%
+-commutative70.5%
associate-/l*75.9%
Simplified75.9%
if 5.4999999999999999e-55 < z < 8.8e73Initial program 91.8%
+-commutative91.8%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around 0 76.3%
mul-1-neg76.3%
unsub-neg76.3%
associate-/l*80.2%
Simplified80.2%
clear-num80.2%
un-div-inv80.3%
Applied egg-rr80.3%
Taylor expanded in z around 0 78.7%
Final simplification77.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+169)
(+ x t)
(if (<= z 5.5e-55)
(+ x (* t (/ y a)))
(if (<= z 4.1e+76) (- x (* t (/ y z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+169) {
tmp = x + t;
} else if (z <= 5.5e-55) {
tmp = x + (t * (y / a));
} else if (z <= 4.1e+76) {
tmp = x - (t * (y / 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 <= (-6.6d+169)) then
tmp = x + t
else if (z <= 5.5d-55) then
tmp = x + (t * (y / a))
else if (z <= 4.1d+76) then
tmp = x - (t * (y / 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 <= -6.6e+169) {
tmp = x + t;
} else if (z <= 5.5e-55) {
tmp = x + (t * (y / a));
} else if (z <= 4.1e+76) {
tmp = x - (t * (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+169: tmp = x + t elif z <= 5.5e-55: tmp = x + (t * (y / a)) elif z <= 4.1e+76: tmp = x - (t * (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+169) tmp = Float64(x + t); elseif (z <= 5.5e-55) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= 4.1e+76) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.6e+169) tmp = x + t; elseif (z <= 5.5e-55) tmp = x + (t * (y / a)); elseif (z <= 4.1e+76) tmp = x - (t * (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+169], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.5e-55], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+76], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+169}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-55}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+76}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.5999999999999994e169 or 4.0999999999999998e76 < z Initial program 72.2%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around inf 81.0%
if -6.5999999999999994e169 < z < 5.4999999999999999e-55Initial program 92.8%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around inf 83.3%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in a around inf 70.5%
+-commutative70.5%
associate-/l*75.9%
Simplified75.9%
if 5.4999999999999999e-55 < z < 4.0999999999999998e76Initial program 91.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 79.6%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in a around 0 74.7%
mul-1-neg74.7%
unsub-neg74.7%
associate-/l*78.6%
Simplified78.6%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.16e-103) (not (<= y 5.6e-75))) (+ x (* t (/ y (- a z)))) (+ x (/ t (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.16e-103) || !(y <= 5.6e-75)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t / ((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 ((y <= (-2.16d-103)) .or. (.not. (y <= 5.6d-75))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (t / ((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 ((y <= -2.16e-103) || !(y <= 5.6e-75)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.16e-103) or not (y <= 5.6e-75): tmp = x + (t * (y / (a - z))) else: tmp = x + (t / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.16e-103) || !(y <= 5.6e-75)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(t / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.16e-103) || ~((y <= 5.6e-75))) tmp = x + (t * (y / (a - z))); else tmp = x + (t / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.16e-103], N[Not[LessEqual[y, 5.6e-75]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.16 \cdot 10^{-103} \lor \neg \left(y \leq 5.6 \cdot 10^{-75}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if y < -2.1599999999999999e-103 or 5.59999999999999996e-75 < y Initial program 83.2%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in y around inf 81.1%
associate-/l*88.0%
Simplified88.0%
if -2.1599999999999999e-103 < y < 5.59999999999999996e-75Initial program 94.1%
+-commutative94.1%
associate-/l*90.7%
fma-define90.8%
Simplified90.8%
Taylor expanded in y around 0 90.5%
mul-1-neg90.5%
unsub-neg90.5%
associate-/l*96.2%
*-commutative96.2%
associate-/r/89.1%
Simplified89.1%
associate-/r/96.2%
Applied egg-rr96.2%
*-commutative96.2%
clear-num96.2%
un-div-inv96.3%
Applied egg-rr96.3%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.6e-103) (not (<= y 6e-71))) (+ x (* t (/ y (- a z)))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.6e-103) || !(y <= 6e-71)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
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.6d-103)) .or. (.not. (y <= 6d-71))) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (t * (z / (z - a)))
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.6e-103) || !(y <= 6e-71)) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.6e-103) or not (y <= 6e-71): tmp = x + (t * (y / (a - z))) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.6e-103) || !(y <= 6e-71)) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.6e-103) || ~((y <= 6e-71))) tmp = x + (t * (y / (a - z))); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.6e-103], N[Not[LessEqual[y, 6e-71]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-103} \lor \neg \left(y \leq 6 \cdot 10^{-71}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -4.6000000000000001e-103 or 6.0000000000000003e-71 < y Initial program 83.2%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in y around inf 81.1%
associate-/l*88.0%
Simplified88.0%
if -4.6000000000000001e-103 < y < 6.0000000000000003e-71Initial program 94.1%
+-commutative94.1%
associate-/l*90.7%
fma-define90.8%
Simplified90.8%
Taylor expanded in y around 0 90.5%
mul-1-neg90.5%
unsub-neg90.5%
associate-/l*96.2%
*-commutative96.2%
associate-/r/89.1%
Simplified89.1%
associate-/r/96.2%
Applied egg-rr96.2%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.6e+169) (not (<= z 8.2e-38))) (- x (* t (/ (- y z) z))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+169) || !(z <= 8.2e-38)) {
tmp = x - (t * ((y - z) / 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 ((z <= (-6.6d+169)) .or. (.not. (z <= 8.2d-38))) then
tmp = x - (t * ((y - z) / 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 ((z <= -6.6e+169) || !(z <= 8.2e-38)) {
tmp = x - (t * ((y - z) / z));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.6e+169) or not (z <= 8.2e-38): tmp = x - (t * ((y - z) / z)) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.6e+169) || !(z <= 8.2e-38)) tmp = Float64(x - Float64(t * Float64(Float64(y - z) / 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 ((z <= -6.6e+169) || ~((z <= 8.2e-38))) tmp = x - (t * ((y - z) / z)); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.6e+169], N[Not[LessEqual[z, 8.2e-38]], $MachinePrecision]], N[(x - N[(t * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+169} \lor \neg \left(z \leq 8.2 \cdot 10^{-38}\right):\\
\;\;\;\;x - t \cdot \frac{y - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -6.5999999999999994e169 or 8.1999999999999996e-38 < z Initial program 76.1%
+-commutative76.1%
associate-/l*95.4%
fma-define95.4%
Simplified95.4%
Taylor expanded in a around 0 69.6%
mul-1-neg69.6%
unsub-neg69.6%
associate-/l*90.8%
Simplified90.8%
if -6.5999999999999994e169 < z < 8.1999999999999996e-38Initial program 92.5%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around inf 82.8%
associate-/l*87.5%
Simplified87.5%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+261) (not (<= z 2.5e+79))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+261) || !(z <= 2.5e+79)) {
tmp = x + t;
} 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 ((z <= (-1.1d+261)) .or. (.not. (z <= 2.5d+79))) then
tmp = x + t
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 ((z <= -1.1e+261) || !(z <= 2.5e+79)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+261) or not (z <= 2.5e+79): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+261) || !(z <= 2.5e+79)) tmp = Float64(x + t); 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 ((z <= -1.1e+261) || ~((z <= 2.5e+79))) tmp = x + t; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+261], N[Not[LessEqual[z, 2.5e+79]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+261} \lor \neg \left(z \leq 2.5 \cdot 10^{+79}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.09999999999999992e261 or 2.5e79 < z Initial program 73.7%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in z around inf 84.1%
if -1.09999999999999992e261 < z < 2.5e79Initial program 90.1%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in y around inf 80.5%
associate-/l*85.7%
Simplified85.7%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.6e+169) (not (<= z 4.2e-55))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+169) || !(z <= 4.2e-55)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
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 <= (-6.6d+169)) .or. (.not. (z <= 4.2d-55))) then
tmp = x + t
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+169) || !(z <= 4.2e-55)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.6e+169) or not (z <= 4.2e-55): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.6e+169) || !(z <= 4.2e-55)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.6e+169) || ~((z <= 4.2e-55))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.6e+169], N[Not[LessEqual[z, 4.2e-55]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+169} \lor \neg \left(z \leq 4.2 \cdot 10^{-55}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -6.5999999999999994e169 or 4.2000000000000003e-55 < z Initial program 76.1%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 75.3%
if -6.5999999999999994e169 < z < 4.2000000000000003e-55Initial program 93.3%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around inf 83.8%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in a around inf 70.9%
+-commutative70.9%
associate-/l*75.7%
Simplified75.7%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.6e+169) (not (<= z 5e-55))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+169) || !(z <= 5e-55)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
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 <= (-6.6d+169)) .or. (.not. (z <= 5d-55))) then
tmp = x + t
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+169) || !(z <= 5e-55)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.6e+169) or not (z <= 5e-55): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.6e+169) || !(z <= 5e-55)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.6e+169) || ~((z <= 5e-55))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.6e+169], N[Not[LessEqual[z, 5e-55]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+169} \lor \neg \left(z \leq 5 \cdot 10^{-55}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -6.5999999999999994e169 or 5.0000000000000002e-55 < z Initial program 76.1%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 75.3%
if -6.5999999999999994e169 < z < 5.0000000000000002e-55Initial program 93.3%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in z around 0 70.9%
*-commutative70.9%
associate-/l*74.4%
Simplified74.4%
Final simplification74.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+91) (not (<= z -1.7e-226))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+91) || !(z <= -1.7e-226)) {
tmp = x + t;
} else {
tmp = x;
}
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.5d+91)) .or. (.not. (z <= (-1.7d-226)))) then
tmp = x + t
else
tmp = x
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.5e+91) || !(z <= -1.7e-226)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+91) or not (z <= -1.7e-226): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+91) || !(z <= -1.7e-226)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.5e+91) || ~((z <= -1.7e-226))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+91], N[Not[LessEqual[z, -1.7e-226]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+91} \lor \neg \left(z \leq -1.7 \cdot 10^{-226}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.50000000000000003e91 or -1.70000000000000004e-226 < z Initial program 83.8%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in z around inf 60.7%
if -1.50000000000000003e91 < z < -1.70000000000000004e-226Initial program 95.4%
+-commutative95.4%
associate-/l*93.9%
fma-define94.0%
Simplified94.0%
Taylor expanded in t around 0 51.4%
Final simplification58.4%
(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 86.7%
+-commutative86.7%
associate-/l*95.0%
fma-define95.0%
Simplified95.0%
Taylor expanded in t around 0 50.9%
(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 2024107
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(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))))