
(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 12 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.6%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in y around 0 85.8%
associate-*r/85.8%
mul-1-neg85.8%
distribute-rgt-neg-out85.8%
associate-*l/91.9%
associate-*l/94.7%
distribute-lft-in95.2%
+-commutative95.2%
sub-neg95.2%
associate-*l/86.6%
associate-*r/98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.05e+65)
(+ x t)
(if (<= z 3.5e-85)
(+ x (/ t (/ a y)))
(if (<= z 9.5e+171) (- x (/ y (/ z t))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.05e+65) {
tmp = x + t;
} else if (z <= 3.5e-85) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e+171) {
tmp = x - (y / (z / t));
} 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 <= (-2.05d+65)) then
tmp = x + t
else if (z <= 3.5d-85) then
tmp = x + (t / (a / y))
else if (z <= 9.5d+171) then
tmp = x - (y / (z / t))
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 <= -2.05e+65) {
tmp = x + t;
} else if (z <= 3.5e-85) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e+171) {
tmp = x - (y / (z / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.05e+65: tmp = x + t elif z <= 3.5e-85: tmp = x + (t / (a / y)) elif z <= 9.5e+171: tmp = x - (y / (z / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.05e+65) tmp = Float64(x + t); elseif (z <= 3.5e-85) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 9.5e+171) tmp = Float64(x - Float64(y / Float64(z / t))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.05e+65) tmp = x + t; elseif (z <= 3.5e-85) tmp = x + (t / (a / y)); elseif (z <= 9.5e+171) tmp = x - (y / (z / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.05e+65], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.5e-85], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+171], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+65}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-85}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+171}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.0500000000000001e65 or 9.49999999999999924e171 < z Initial program 69.3%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 89.0%
if -2.0500000000000001e65 < z < 3.49999999999999978e-85Initial program 97.3%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
associate-/l*79.6%
Simplified79.6%
clear-num79.5%
un-div-inv80.5%
Applied egg-rr80.5%
if 3.49999999999999978e-85 < z < 9.49999999999999924e171Initial program 89.0%
associate-/l*96.7%
Simplified96.7%
clear-num95.6%
un-div-inv95.7%
Applied egg-rr95.7%
Taylor expanded in y around inf 77.9%
Taylor expanded in a around 0 68.9%
neg-mul-168.9%
Simplified68.9%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.4e+66)
(+ x t)
(if (<= z 3.6e-85)
(+ x (/ t (/ a y)))
(if (<= z 6.5e+169) (- x (* y (/ t z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.4e+66) {
tmp = x + t;
} else if (z <= 3.6e-85) {
tmp = x + (t / (a / y));
} else if (z <= 6.5e+169) {
tmp = x - (y * (t / 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 <= (-5.4d+66)) then
tmp = x + t
else if (z <= 3.6d-85) then
tmp = x + (t / (a / y))
else if (z <= 6.5d+169) then
tmp = x - (y * (t / 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 <= -5.4e+66) {
tmp = x + t;
} else if (z <= 3.6e-85) {
tmp = x + (t / (a / y));
} else if (z <= 6.5e+169) {
tmp = x - (y * (t / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.4e+66: tmp = x + t elif z <= 3.6e-85: tmp = x + (t / (a / y)) elif z <= 6.5e+169: tmp = x - (y * (t / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.4e+66) tmp = Float64(x + t); elseif (z <= 3.6e-85) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 6.5e+169) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.4e+66) tmp = x + t; elseif (z <= 3.6e-85) tmp = x + (t / (a / y)); elseif (z <= 6.5e+169) tmp = x - (y * (t / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.4e+66], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.6e-85], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+169], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+66}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-85}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+169}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -5.4e66 or 6.4999999999999995e169 < z Initial program 69.3%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 89.0%
if -5.4e66 < z < 3.5999999999999998e-85Initial program 97.3%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
associate-/l*79.6%
Simplified79.6%
clear-num79.5%
un-div-inv80.5%
Applied egg-rr80.5%
if 3.5999999999999998e-85 < z < 6.4999999999999995e169Initial program 89.0%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around inf 75.3%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in a around 0 68.9%
associate-*r/68.9%
neg-mul-168.9%
Simplified68.9%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2e+53)
(+ x t)
(if (<= z 3.6e-85)
(+ x (/ t (/ a y)))
(if (<= z 6e+169) (- x (* t (/ y z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+53) {
tmp = x + t;
} else if (z <= 3.6e-85) {
tmp = x + (t / (a / y));
} else if (z <= 6e+169) {
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 <= (-2d+53)) then
tmp = x + t
else if (z <= 3.6d-85) then
tmp = x + (t / (a / y))
else if (z <= 6d+169) 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 <= -2e+53) {
tmp = x + t;
} else if (z <= 3.6e-85) {
tmp = x + (t / (a / y));
} else if (z <= 6e+169) {
tmp = x - (t * (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+53: tmp = x + t elif z <= 3.6e-85: tmp = x + (t / (a / y)) elif z <= 6e+169: tmp = x - (t * (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+53) tmp = Float64(x + t); elseif (z <= 3.6e-85) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 6e+169) 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 <= -2e+53) tmp = x + t; elseif (z <= 3.6e-85) tmp = x + (t / (a / y)); elseif (z <= 6e+169) tmp = x - (t * (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+53], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.6e-85], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+169], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+53}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-85}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+169}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2e53 or 5.9999999999999999e169 < z Initial program 69.3%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 89.0%
if -2e53 < z < 3.5999999999999998e-85Initial program 97.3%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
associate-/l*79.6%
Simplified79.6%
clear-num79.5%
un-div-inv80.5%
Applied egg-rr80.5%
if 3.5999999999999998e-85 < z < 5.9999999999999999e169Initial program 89.0%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around inf 75.3%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in a around 0 66.3%
mul-1-neg66.3%
unsub-neg66.3%
associate-/l*68.9%
Simplified68.9%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.75e+31) (not (<= y 45000000000.0))) (+ x (* y (/ t (- a z)))) (+ x (* z (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.75e+31) || !(y <= 45000000000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (t / (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 <= (-1.75d+31)) .or. (.not. (y <= 45000000000.0d0))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (z * (t / (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 <= -1.75e+31) || !(y <= 45000000000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.75e+31) or not (y <= 45000000000.0): tmp = x + (y * (t / (a - z))) else: tmp = x + (z * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.75e+31) || !(y <= 45000000000.0)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.75e+31) || ~((y <= 45000000000.0))) tmp = x + (y * (t / (a - z))); else tmp = x + (z * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.75e+31], N[Not[LessEqual[y, 45000000000.0]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+31} \lor \neg \left(y \leq 45000000000\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if y < -1.75e31 or 4.5e10 < y Initial program 88.2%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around inf 84.5%
associate-*l/89.5%
*-commutative89.5%
Simplified89.5%
if -1.75e31 < y < 4.5e10Initial program 85.4%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in y around 0 76.9%
associate-*r/76.9%
mul-1-neg76.9%
distribute-rgt-neg-out76.9%
associate-*l/87.1%
Simplified87.1%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+81) (not (<= z 7.6e+123))) (+ x (* t (/ (- z y) z))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+81) || !(z <= 7.6e+123)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x + (y * (t / (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 <= (-2.6d+81)) .or. (.not. (z <= 7.6d+123))) then
tmp = x + (t * ((z - y) / z))
else
tmp = x + (y * (t / (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 <= -2.6e+81) || !(z <= 7.6e+123)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+81) or not (z <= 7.6e+123): tmp = x + (t * ((z - y) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+81) || !(z <= 7.6e+123)) tmp = Float64(x + Float64(t * Float64(Float64(z - y) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.6e+81) || ~((z <= 7.6e+123))) tmp = x + (t * ((z - y) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+81], N[Not[LessEqual[z, 7.6e+123]], $MachinePrecision]], N[(x + N[(t * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+81} \lor \neg \left(z \leq 7.6 \cdot 10^{+123}\right):\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -2.59999999999999992e81 or 7.59999999999999989e123 < z Initial program 71.3%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in a around 0 69.0%
mul-1-neg69.0%
unsub-neg69.0%
associate-/l*95.6%
Simplified95.6%
if -2.59999999999999992e81 < z < 7.59999999999999989e123Initial program 94.8%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in y around inf 81.6%
associate-*l/82.7%
*-commutative82.7%
Simplified82.7%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.18e+82) (not (<= z 6e+169))) (+ x t) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.18e+82) || !(z <= 6e+169)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (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.18d+82)) .or. (.not. (z <= 6d+169))) then
tmp = x + t
else
tmp = x + (y * (t / (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.18e+82) || !(z <= 6e+169)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.18e+82) or not (z <= 6e+169): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.18e+82) || !(z <= 6e+169)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.18e+82) || ~((z <= 6e+169))) tmp = x + t; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.18e+82], N[Not[LessEqual[z, 6e+169]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{+82} \lor \neg \left(z \leq 6 \cdot 10^{+169}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.1800000000000001e82 or 5.9999999999999999e169 < z Initial program 68.5%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in z around inf 88.7%
if -1.1800000000000001e82 < z < 5.9999999999999999e169Initial program 94.2%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around inf 81.4%
associate-*l/82.3%
*-commutative82.3%
Simplified82.3%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.8e+68) (not (<= z 2.9e+39))) (+ x t) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.8e+68) || !(z <= 2.9e+39)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
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 <= (-9.8d+68)) .or. (.not. (z <= 2.9d+39))) then
tmp = x + t
else
tmp = x + (t / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.8e+68) || !(z <= 2.9e+39)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.8e+68) or not (z <= 2.9e+39): tmp = x + t else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.8e+68) || !(z <= 2.9e+39)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.8e+68) || ~((z <= 2.9e+39))) tmp = x + t; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.8e+68], N[Not[LessEqual[z, 2.9e+39]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+68} \lor \neg \left(z \leq 2.9 \cdot 10^{+39}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -9.79999999999999956e68 or 2.90000000000000029e39 < z Initial program 73.6%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 77.7%
if -9.79999999999999956e68 < z < 2.90000000000000029e39Initial program 97.8%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around 0 74.0%
+-commutative74.0%
associate-/l*74.6%
Simplified74.6%
clear-num74.6%
un-div-inv75.3%
Applied egg-rr75.3%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.4e+56) (not (<= z 4.4e+39))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.4e+56) || !(z <= 4.4e+39)) {
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 <= (-7.4d+56)) .or. (.not. (z <= 4.4d+39))) 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 <= -7.4e+56) || !(z <= 4.4e+39)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.4e+56) or not (z <= 4.4e+39): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.4e+56) || !(z <= 4.4e+39)) 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 <= -7.4e+56) || ~((z <= 4.4e+39))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.4e+56], N[Not[LessEqual[z, 4.4e+39]], $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 -7.4 \cdot 10^{+56} \lor \neg \left(z \leq 4.4 \cdot 10^{+39}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -7.39999999999999994e56 or 4.4000000000000003e39 < z Initial program 73.6%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 77.7%
if -7.39999999999999994e56 < z < 4.4000000000000003e39Initial program 97.8%
associate-/l*93.8%
Simplified93.8%
clear-num93.7%
un-div-inv93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 74.0%
associate-*r/74.6%
Simplified74.6%
Final simplification76.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.5e+153) x (if (<= a 6000000.0) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+153) {
tmp = x;
} else if (a <= 6000000.0) {
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 (a <= (-9.5d+153)) then
tmp = x
else if (a <= 6000000.0d0) 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 (a <= -9.5e+153) {
tmp = x;
} else if (a <= 6000000.0) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e+153: tmp = x elif a <= 6000000.0: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+153) tmp = x; elseif (a <= 6000000.0) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.5e+153) tmp = x; elseif (a <= 6000000.0) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+153], x, If[LessEqual[a, 6000000.0], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+153}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6000000:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.4999999999999995e153 or 6e6 < a Initial program 87.1%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in x around inf 64.6%
if -9.4999999999999995e153 < a < 6e6Initial program 86.4%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in z around inf 63.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1e+120) t x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e+120) {
tmp = 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 (t <= (-1d+120)) then
tmp = 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 (t <= -1e+120) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1e+120: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1e+120) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1e+120) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1e+120], t, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+120}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.9999999999999998e119Initial program 57.8%
associate-/l*92.4%
Simplified92.4%
Taylor expanded in y around 0 29.6%
mul-1-neg29.6%
distribute-neg-frac229.6%
neg-sub029.6%
sub-neg29.6%
+-commutative29.6%
associate--r+29.6%
neg-sub029.6%
remove-double-neg29.6%
Simplified29.6%
Taylor expanded in x around 0 24.6%
associate-*r/54.5%
Simplified54.5%
Taylor expanded in z around inf 38.4%
if -9.9999999999999998e119 < t Initial program 91.7%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in x around inf 59.9%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 86.6%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in y around 0 64.3%
mul-1-neg64.3%
distribute-neg-frac264.3%
neg-sub064.3%
sub-neg64.3%
+-commutative64.3%
associate--r+64.3%
neg-sub064.3%
remove-double-neg64.3%
Simplified64.3%
Taylor expanded in x around 0 16.5%
associate-*r/22.8%
Simplified22.8%
Taylor expanded in z around inf 16.0%
(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 2024135
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))