
(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 9 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.8%
associate-*l/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.02e+152) (+ x t) (if (<= z 1.8e+69) (+ x (* t (/ y (- a z)))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.02e+152) {
tmp = x + t;
} else if (z <= 1.8e+69) {
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 <= (-1.02d+152)) then
tmp = x + t
else if (z <= 1.8d+69) 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 <= -1.02e+152) {
tmp = x + t;
} else if (z <= 1.8e+69) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.02e+152: tmp = x + t elif z <= 1.8e+69: tmp = x + (t * (y / (a - z))) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.02e+152) tmp = Float64(x + t); elseif (z <= 1.8e+69) 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 <= -1.02e+152) tmp = x + t; elseif (z <= 1.8e+69) tmp = x + (t * (y / (a - z))); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.02e+152], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.8e+69], 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 -1.02 \cdot 10^{+152}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+69}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.01999999999999999e152 or 1.8000000000000001e69 < z Initial program 74.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 87.4%
if -1.01999999999999999e152 < z < 1.8000000000000001e69Initial program 90.1%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in y around inf 82.5%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.2e+52) (+ x (* t (/ y (- a z)))) (if (<= y 7e+73) (- x (* z (/ t (- a z)))) (+ x (/ t (/ (- a z) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.2e+52) {
tmp = x + (t * (y / (a - z)));
} else if (y <= 7e+73) {
tmp = x - (z * (t / (a - z)));
} else {
tmp = x + (t / ((a - z) / 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 (y <= (-2.2d+52)) then
tmp = x + (t * (y / (a - z)))
else if (y <= 7d+73) then
tmp = x - (z * (t / (a - z)))
else
tmp = x + (t / ((a - z) / y))
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.2e+52) {
tmp = x + (t * (y / (a - z)));
} else if (y <= 7e+73) {
tmp = x - (z * (t / (a - z)));
} else {
tmp = x + (t / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.2e+52: tmp = x + (t * (y / (a - z))) elif y <= 7e+73: tmp = x - (z * (t / (a - z))) else: tmp = x + (t / ((a - z) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.2e+52) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (y <= 7e+73) tmp = Float64(x - Float64(z * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.2e+52) tmp = x + (t * (y / (a - z))); elseif (y <= 7e+73) tmp = x - (z * (t / (a - z))); else tmp = x + (t / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.2e+52], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+73], N[(x - N[(z * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+52}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+73}:\\
\;\;\;\;x - z \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if y < -2.2e52Initial program 82.3%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in y around inf 85.3%
if -2.2e52 < y < 7.00000000000000004e73Initial program 86.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 78.8%
mul-1-neg78.8%
unsub-neg78.8%
Simplified78.8%
div-inv78.8%
*-commutative78.8%
associate-*l*87.6%
div-inv87.7%
Applied egg-rr87.7%
if 7.00000000000000004e73 < y Initial program 84.5%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in y around inf 79.2%
associate-/l*87.8%
Simplified87.8%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (<= y -3e+52) (+ x (* t (/ y (- a z)))) (if (<= y 8e+73) (- x (/ t (/ (- a z) z))) (+ x (/ t (/ (- a z) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3e+52) {
tmp = x + (t * (y / (a - z)));
} else if (y <= 8e+73) {
tmp = x - (t / ((a - z) / z));
} else {
tmp = x + (t / ((a - z) / 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 (y <= (-3d+52)) then
tmp = x + (t * (y / (a - z)))
else if (y <= 8d+73) then
tmp = x - (t / ((a - z) / z))
else
tmp = x + (t / ((a - z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3e+52) {
tmp = x + (t * (y / (a - z)));
} else if (y <= 8e+73) {
tmp = x - (t / ((a - z) / z));
} else {
tmp = x + (t / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3e+52: tmp = x + (t * (y / (a - z))) elif y <= 8e+73: tmp = x - (t / ((a - z) / z)) else: tmp = x + (t / ((a - z) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3e+52) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (y <= 8e+73) tmp = Float64(x - Float64(t / Float64(Float64(a - z) / z))); else tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3e+52) tmp = x + (t * (y / (a - z))); elseif (y <= 8e+73) tmp = x - (t / ((a - z) / z)); else tmp = x + (t / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3e+52], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+73], N[(x - N[(t / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+52}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+73}:\\
\;\;\;\;x - \frac{t}{\frac{a - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if y < -3e52Initial program 82.3%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in y around inf 85.3%
if -3e52 < y < 7.99999999999999986e73Initial program 86.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around 0 78.8%
+-commutative78.8%
mul-1-neg78.8%
associate-/l*92.7%
Simplified92.7%
if 7.99999999999999986e73 < y Initial program 84.5%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in y around inf 79.2%
associate-/l*87.8%
Simplified87.8%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.8e-16) (+ x t) (if (<= z 3.4e+65) (+ x (* t (/ y a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e-16) {
tmp = x + t;
} else if (z <= 3.4e+65) {
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 <= (-5.8d-16)) then
tmp = x + t
else if (z <= 3.4d+65) 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 <= -5.8e-16) {
tmp = x + t;
} else if (z <= 3.4e+65) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e-16: tmp = x + t elif z <= 3.4e+65: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e-16) tmp = Float64(x + t); elseif (z <= 3.4e+65) 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 <= -5.8e-16) tmp = x + t; elseif (z <= 3.4e+65) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e-16], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.4e+65], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-16}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+65}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -5.7999999999999996e-16 or 3.3999999999999999e65 < z Initial program 76.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.9%
if -5.7999999999999996e-16 < z < 3.3999999999999999e65Initial program 93.4%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in z around 0 77.9%
Final simplification77.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.8e-17) (+ x t) (if (<= z 7.2e+65) (+ x (* y (/ t a))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e-17) {
tmp = x + t;
} else if (z <= 7.2e+65) {
tmp = x + (y * (t / 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 <= (-6.8d-17)) then
tmp = x + t
else if (z <= 7.2d+65) then
tmp = x + (y * (t / 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 <= -6.8e-17) {
tmp = x + t;
} else if (z <= 7.2e+65) {
tmp = x + (y * (t / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e-17: tmp = x + t elif z <= 7.2e+65: tmp = x + (y * (t / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e-17) tmp = Float64(x + t); elseif (z <= 7.2e+65) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.8e-17) tmp = x + t; elseif (z <= 7.2e+65) tmp = x + (y * (t / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e-17], N[(x + t), $MachinePrecision], If[LessEqual[z, 7.2e+65], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-17}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+65}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.7999999999999996e-17 or 7.19999999999999957e65 < z Initial program 76.0%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.9%
if -6.7999999999999996e-17 < z < 7.19999999999999957e65Initial program 93.4%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in z around 0 75.1%
+-commutative75.1%
associate-/l*77.8%
Simplified77.8%
associate-/r/80.0%
Applied egg-rr80.0%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.8e-97) (+ x t) (if (<= z 3.5e+15) x (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-97) {
tmp = x + t;
} else if (z <= 3.5e+15) {
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 <= (-4.8d-97)) then
tmp = x + t
else if (z <= 3.5d+15) 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 <= -4.8e-97) {
tmp = x + t;
} else if (z <= 3.5e+15) {
tmp = x;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e-97: tmp = x + t elif z <= 3.5e+15: tmp = x else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e-97) tmp = Float64(x + t); elseif (z <= 3.5e+15) 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 <= -4.8e-97) tmp = x + t; elseif (z <= 3.5e+15) tmp = x; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e-97], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.5e+15], x, N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-97}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -4.8e-97 or 3.5e15 < z Initial program 77.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.2%
if -4.8e-97 < z < 3.5e15Initial program 96.1%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in x around inf 48.3%
Final simplification63.0%
(FPCore (x y z t a) :precision binary64 (if (<= x -5.4e-98) x (if (<= x 1.15e-40) t x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.4e-98) {
tmp = x;
} else if (x <= 1.15e-40) {
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 (x <= (-5.4d-98)) then
tmp = x
else if (x <= 1.15d-40) 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 (x <= -5.4e-98) {
tmp = x;
} else if (x <= 1.15e-40) {
tmp = t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -5.4e-98: tmp = x elif x <= 1.15e-40: tmp = t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -5.4e-98) tmp = x; elseif (x <= 1.15e-40) tmp = t; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -5.4e-98) tmp = x; elseif (x <= 1.15e-40) tmp = t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.4e-98], x, If[LessEqual[x, 1.15e-40], t, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-98}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-40}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.3999999999999997e-98 or 1.15e-40 < x Initial program 82.7%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in x around inf 63.2%
if -5.3999999999999997e-98 < x < 1.15e-40Initial program 88.9%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in a around 0 60.2%
associate-*r/60.2%
neg-mul-160.2%
neg-sub060.2%
associate--r-60.2%
neg-sub060.2%
Simplified60.2%
Taylor expanded in t around inf 49.9%
Taylor expanded in y around 0 32.1%
Final simplification52.7%
(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 84.8%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in a around 0 65.8%
associate-*r/65.8%
neg-mul-165.8%
neg-sub065.8%
associate--r-65.8%
neg-sub065.8%
Simplified65.8%
Taylor expanded in t around inf 30.9%
Taylor expanded in y around 0 19.7%
Final simplification19.7%
(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 2023271
(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))))