
(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 10 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 88.2%
associate-*l/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.4e-80)
(+ x t)
(if (<= z 3.4e-75)
(+ x (/ y (/ a t)))
(if (<= z 1.9e-32)
(- x (* y (/ t z)))
(if (<= z 9e+31) (+ x (* t (/ y a))) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e-80) {
tmp = x + t;
} else if (z <= 3.4e-75) {
tmp = x + (y / (a / t));
} else if (z <= 1.9e-32) {
tmp = x - (y * (t / z));
} else if (z <= 9e+31) {
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 <= (-3.4d-80)) then
tmp = x + t
else if (z <= 3.4d-75) then
tmp = x + (y / (a / t))
else if (z <= 1.9d-32) then
tmp = x - (y * (t / z))
else if (z <= 9d+31) 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 <= -3.4e-80) {
tmp = x + t;
} else if (z <= 3.4e-75) {
tmp = x + (y / (a / t));
} else if (z <= 1.9e-32) {
tmp = x - (y * (t / z));
} else if (z <= 9e+31) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.4e-80: tmp = x + t elif z <= 3.4e-75: tmp = x + (y / (a / t)) elif z <= 1.9e-32: tmp = x - (y * (t / z)) elif z <= 9e+31: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.4e-80) tmp = Float64(x + t); elseif (z <= 3.4e-75) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 1.9e-32) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 9e+31) 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 <= -3.4e-80) tmp = x + t; elseif (z <= 3.4e-75) tmp = x + (y / (a / t)); elseif (z <= 1.9e-32) tmp = x - (y * (t / z)); elseif (z <= 9e+31) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.4e-80], N[(x + t), $MachinePrecision], If[LessEqual[z, 3.4e-75], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-32], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+31], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-80}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-75}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-32}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+31}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.4000000000000001e-80 or 8.9999999999999992e31 < z Initial program 78.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -3.4000000000000001e-80 < z < 3.40000000000000015e-75Initial program 97.3%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in z around 0 90.0%
associate-/l*89.1%
associate-/r/89.9%
Applied egg-rr89.9%
*-commutative89.9%
clear-num89.8%
un-div-inv90.3%
Applied egg-rr90.3%
if 3.40000000000000015e-75 < z < 1.90000000000000004e-32Initial program 99.7%
associate-/l*99.8%
clear-num99.5%
associate-/r/99.5%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in y around inf 89.2%
associate-*l/88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in a around 0 77.1%
associate-*r/77.1%
neg-mul-177.1%
Simplified77.1%
if 1.90000000000000004e-32 < z < 8.9999999999999992e31Initial program 99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around 0 81.2%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e+22) (not (<= z 2.6e+69))) (+ x t) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e+22) || !(z <= 2.6e+69)) {
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 <= (-4.4d+22)) .or. (.not. (z <= 2.6d+69))) 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 <= -4.4e+22) || !(z <= 2.6e+69)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.4e+22) or not (z <= 2.6e+69): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.4e+22) || !(z <= 2.6e+69)) 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 <= -4.4e+22) || ~((z <= 2.6e+69))) 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, -4.4e+22], N[Not[LessEqual[z, 2.6e+69]], $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 -4.4 \cdot 10^{+22} \lor \neg \left(z \leq 2.6 \cdot 10^{+69}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -4.4e22 or 2.6000000000000002e69 < z Initial program 73.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 83.7%
if -4.4e22 < z < 2.6000000000000002e69Initial program 97.6%
associate-/l*96.5%
clear-num96.4%
associate-/r/96.2%
clear-num96.2%
Applied egg-rr96.2%
Taylor expanded in y around inf 90.8%
associate-*l/90.6%
*-commutative90.6%
Simplified90.6%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e+117) (not (<= z 2.05e+150))) (+ x t) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e+117) || !(z <= 2.05e+150)) {
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 <= (-9.2d+117)) .or. (.not. (z <= 2.05d+150))) 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 <= -9.2e+117) || !(z <= 2.05e+150)) {
tmp = x + t;
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e+117) or not (z <= 2.05e+150): tmp = x + t else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e+117) || !(z <= 2.05e+150)) tmp = Float64(x + t); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.2e+117) || ~((z <= 2.05e+150))) 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, -9.2e+117], N[Not[LessEqual[z, 2.05e+150]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+117} \lor \neg \left(z \leq 2.05 \cdot 10^{+150}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -9.19999999999999951e117 or 2.04999999999999997e150 < z Initial program 63.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 84.8%
if -9.19999999999999951e117 < z < 2.04999999999999997e150Initial program 97.4%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in y around inf 89.4%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e-39) (not (<= z 4.8e+33))) (- x (* t (+ (/ y z) -1.0))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e-39) || !(z <= 4.8e+33)) {
tmp = x - (t * ((y / z) + -1.0));
} 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 <= (-4.3d-39)) .or. (.not. (z <= 4.8d+33))) then
tmp = x - (t * ((y / z) + (-1.0d0)))
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 <= -4.3e-39) || !(z <= 4.8e+33)) {
tmp = x - (t * ((y / z) + -1.0));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e-39) or not (z <= 4.8e+33): tmp = x - (t * ((y / z) + -1.0)) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e-39) || !(z <= 4.8e+33)) tmp = Float64(x - Float64(t * Float64(Float64(y / z) + -1.0))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.3e-39) || ~((z <= 4.8e+33))) tmp = x - (t * ((y / z) + -1.0)); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e-39], N[Not[LessEqual[z, 4.8e+33]], $MachinePrecision]], N[(x - N[(t * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-39} \lor \neg \left(z \leq 4.8 \cdot 10^{+33}\right):\\
\;\;\;\;x - t \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -4.2999999999999999e-39 or 4.8e33 < z Initial program 77.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 89.2%
mul-1-neg89.2%
div-sub89.3%
sub-neg89.3%
*-inverses89.3%
metadata-eval89.3%
Simplified89.3%
distribute-lft-neg-out89.3%
unsub-neg89.3%
*-commutative89.3%
Applied egg-rr89.3%
if -4.2999999999999999e-39 < z < 4.8e33Initial program 97.8%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in y around inf 92.1%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.6e-82) (not (<= z 3.3e+34))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.6e-82) || !(z <= 3.3e+34)) {
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 <= (-3.6d-82)) .or. (.not. (z <= 3.3d+34))) 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 <= -3.6e-82) || !(z <= 3.3e+34)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.6e-82) or not (z <= 3.3e+34): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.6e-82) || !(z <= 3.3e+34)) 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 <= -3.6e-82) || ~((z <= 3.3e+34))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.6e-82], N[Not[LessEqual[z, 3.3e+34]], $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 -3.6 \cdot 10^{-82} \lor \neg \left(z \leq 3.3 \cdot 10^{+34}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.59999999999999998e-82 or 3.29999999999999988e34 < z Initial program 78.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -3.59999999999999998e-82 < z < 3.29999999999999988e34Initial program 97.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in z around 0 85.1%
associate-/l*83.8%
associate-/r/85.0%
Applied egg-rr85.0%
Final simplification81.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e-79) (not (<= z 6.8e+31))) (+ x t) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e-79) || !(z <= 6.8e+31)) {
tmp = x + t;
} else {
tmp = x + (y / (a / 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.1d-79)) .or. (.not. (z <= 6.8d+31))) then
tmp = x + t
else
tmp = x + (y / (a / 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.1e-79) || !(z <= 6.8e+31)) {
tmp = x + t;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e-79) or not (z <= 6.8e+31): tmp = x + t else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e-79) || !(z <= 6.8e+31)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e-79) || ~((z <= 6.8e+31))) tmp = x + t; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e-79], N[Not[LessEqual[z, 6.8e+31]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-79} \lor \neg \left(z \leq 6.8 \cdot 10^{+31}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.0999999999999999e-79 or 6.7999999999999996e31 < z Initial program 78.9%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -1.0999999999999999e-79 < z < 6.7999999999999996e31Initial program 97.7%
associate-*l/94.5%
Simplified94.5%
Taylor expanded in z around 0 85.1%
associate-/l*83.8%
associate-/r/85.0%
Applied egg-rr85.0%
*-commutative85.0%
clear-num85.0%
un-div-inv85.4%
Applied egg-rr85.4%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e-81) (not (<= z 4.7e-88))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e-81) || !(z <= 4.7e-88)) {
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.85d-81)) .or. (.not. (z <= 4.7d-88))) 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.85e-81) || !(z <= 4.7e-88)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e-81) or not (z <= 4.7e-88): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e-81) || !(z <= 4.7e-88)) 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.85e-81) || ~((z <= 4.7e-88))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e-81], N[Not[LessEqual[z, 4.7e-88]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-81} \lor \neg \left(z \leq 4.7 \cdot 10^{-88}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.84999999999999993e-81 or 4.7e-88 < z Initial program 82.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in z around inf 73.3%
if -1.84999999999999993e-81 < z < 4.7e-88Initial program 97.2%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 91.5%
Taylor expanded in x around inf 52.6%
Final simplification64.9%
(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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 88.2%
associate-/l*95.2%
clear-num95.1%
associate-/r/95.0%
clear-num95.4%
Applied egg-rr95.4%
Final simplification95.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 88.2%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 66.1%
Taylor expanded in x around inf 52.1%
Final simplification52.1%
(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 2024031
(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))))