
(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
(let* ((t_1 (* t (- y z))) (t_2 (/ t_1 (- a z))))
(if (or (<= t_2 -0.001) (not (<= t_2 1e+306)))
(+ x (* (- y z) (/ t (- a z))))
(- x (/ t_1 (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y - z);
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -0.001) || !(t_2 <= 1e+306)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x - (t_1 / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (y - z)
t_2 = t_1 / (a - z)
if ((t_2 <= (-0.001d0)) .or. (.not. (t_2 <= 1d+306))) then
tmp = x + ((y - z) * (t / (a - z)))
else
tmp = x - (t_1 / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y - z);
double t_2 = t_1 / (a - z);
double tmp;
if ((t_2 <= -0.001) || !(t_2 <= 1e+306)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x - (t_1 / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y - z) t_2 = t_1 / (a - z) tmp = 0 if (t_2 <= -0.001) or not (t_2 <= 1e+306): tmp = x + ((y - z) * (t / (a - z))) else: tmp = x - (t_1 / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y - z)) t_2 = Float64(t_1 / Float64(a - z)) tmp = 0.0 if ((t_2 <= -0.001) || !(t_2 <= 1e+306)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(t_1 / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y - z); t_2 = t_1 / (a - z); tmp = 0.0; if ((t_2 <= -0.001) || ~((t_2 <= 1e+306))) tmp = x + ((y - z) * (t / (a - z))); else tmp = x - (t_1 / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -0.001], N[Not[LessEqual[t$95$2, 1e+306]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t$95$1 / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(y - z\right)\\
t_2 := \frac{t\_1}{a - z}\\
\mathbf{if}\;t\_2 \leq -0.001 \lor \neg \left(t\_2 \leq 10^{+306}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -1e-3 or 1.00000000000000002e306 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 65.1%
associate-/l*99.9%
Simplified99.9%
if -1e-3 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.00000000000000002e306Initial program 99.7%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -32000000.0)
(+ x t)
(if (<= z 1.16e-23)
(+ x (/ (* t y) a))
(if (<= z 3.3e+97) (- x (* t (/ y z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -32000000.0) {
tmp = x + t;
} else if (z <= 1.16e-23) {
tmp = x + ((t * y) / a);
} else if (z <= 3.3e+97) {
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 <= (-32000000.0d0)) then
tmp = x + t
else if (z <= 1.16d-23) then
tmp = x + ((t * y) / a)
else if (z <= 3.3d+97) 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 <= -32000000.0) {
tmp = x + t;
} else if (z <= 1.16e-23) {
tmp = x + ((t * y) / a);
} else if (z <= 3.3e+97) {
tmp = x - (t * (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -32000000.0: tmp = x + t elif z <= 1.16e-23: tmp = x + ((t * y) / a) elif z <= 3.3e+97: tmp = x - (t * (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -32000000.0) tmp = Float64(x + t); elseif (z <= 1.16e-23) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (z <= 3.3e+97) 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 <= -32000000.0) tmp = x + t; elseif (z <= 1.16e-23) tmp = x + ((t * y) / a); elseif (z <= 3.3e+97) tmp = x - (t * (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -32000000.0], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.16e-23], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+97], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -32000000:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+97}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -3.2e7 or 3.3000000000000001e97 < z Initial program 73.6%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around inf 79.4%
if -3.2e7 < z < 1.1599999999999999e-23Initial program 98.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 84.4%
+-commutative84.4%
Simplified84.4%
if 1.1599999999999999e-23 < z < 3.3000000000000001e97Initial program 90.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 76.9%
Taylor expanded in a around 0 68.9%
mul-1-neg68.9%
unsub-neg68.9%
associate-/l*71.8%
Simplified71.8%
Final simplification80.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -12000.0)
(+ x t)
(if (<= z 9.8e-24)
(+ x (/ (* t y) a))
(if (<= z 2e+99) (- x (* y (/ t z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -12000.0) {
tmp = x + t;
} else if (z <= 9.8e-24) {
tmp = x + ((t * y) / a);
} else if (z <= 2e+99) {
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 <= (-12000.0d0)) then
tmp = x + t
else if (z <= 9.8d-24) then
tmp = x + ((t * y) / a)
else if (z <= 2d+99) 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 <= -12000.0) {
tmp = x + t;
} else if (z <= 9.8e-24) {
tmp = x + ((t * y) / a);
} else if (z <= 2e+99) {
tmp = x - (y * (t / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -12000.0: tmp = x + t elif z <= 9.8e-24: tmp = x + ((t * y) / a) elif z <= 2e+99: tmp = x - (y * (t / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -12000.0) tmp = Float64(x + t); elseif (z <= 9.8e-24) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (z <= 2e+99) 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 <= -12000.0) tmp = x + t; elseif (z <= 9.8e-24) tmp = x + ((t * y) / a); elseif (z <= 2e+99) tmp = x - (y * (t / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -12000.0], N[(x + t), $MachinePrecision], If[LessEqual[z, 9.8e-24], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+99], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -12000:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-24}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+99}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -12000 or 1.9999999999999999e99 < z Initial program 73.6%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around inf 79.4%
if -12000 < z < 9.8000000000000002e-24Initial program 98.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 84.4%
+-commutative84.4%
Simplified84.4%
if 9.8000000000000002e-24 < z < 1.9999999999999999e99Initial program 90.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 76.9%
Taylor expanded in a around 0 68.9%
mul-1-neg68.9%
unsub-neg68.9%
associate-/l*71.8%
Simplified71.8%
associate-*r/68.9%
clear-num68.8%
Applied egg-rr68.8%
clear-num68.9%
*-commutative68.9%
associate-/l*71.8%
Applied egg-rr71.8%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e+38) (not (<= z 1.4e+104))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e+38) || !(z <= 1.4e+104)) {
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 <= (-4.2d+38)) .or. (.not. (z <= 1.4d+104))) 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 <= -4.2e+38) || !(z <= 1.4e+104)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e+38) or not (z <= 1.4e+104): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e+38) || !(z <= 1.4e+104)) 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 <= -4.2e+38) || ~((z <= 1.4e+104))) 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, -4.2e+38], N[Not[LessEqual[z, 1.4e+104]], $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 -4.2 \cdot 10^{+38} \lor \neg \left(z \leq 1.4 \cdot 10^{+104}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -4.2e38 or 1.4e104 < z Initial program 72.3%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around inf 82.3%
if -4.2e38 < z < 1.4e104Initial program 96.8%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in y around inf 90.5%
associate-/l*91.3%
Simplified91.3%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -14.0) (not (<= y 1.2e+35))) (+ 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 <= -14.0) || !(y <= 1.2e+35)) {
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 <= (-14.0d0)) .or. (.not. (y <= 1.2d+35))) 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 <= -14.0) || !(y <= 1.2e+35)) {
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 <= -14.0) or not (y <= 1.2e+35): 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 <= -14.0) || !(y <= 1.2e+35)) 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 <= -14.0) || ~((y <= 1.2e+35))) 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, -14.0], N[Not[LessEqual[y, 1.2e+35]], $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 -14 \lor \neg \left(y \leq 1.2 \cdot 10^{+35}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -14 or 1.20000000000000007e35 < y Initial program 86.4%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in y around inf 83.2%
associate-/l*90.2%
Simplified90.2%
if -14 < y < 1.20000000000000007e35Initial program 88.1%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around 0 81.3%
mul-1-neg81.3%
unsub-neg81.3%
associate-/l*92.9%
Simplified92.9%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3600.0) (not (<= z 8.8e+94))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3600.0) || !(z <= 8.8e+94)) {
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 <= (-3600.0d0)) .or. (.not. (z <= 8.8d+94))) 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 <= -3600.0) || !(z <= 8.8e+94)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3600.0) or not (z <= 8.8e+94): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3600.0) || !(z <= 8.8e+94)) 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 <= -3600.0) || ~((z <= 8.8e+94))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3600.0], N[Not[LessEqual[z, 8.8e+94]], $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 -3600 \lor \neg \left(z \leq 8.8 \cdot 10^{+94}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3600 or 8.80000000000000047e94 < z Initial program 73.6%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around inf 79.4%
if -3600 < z < 8.80000000000000047e94Initial program 96.7%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in z around 0 77.8%
*-commutative77.8%
associate-/l*77.9%
Simplified77.9%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-10) (not (<= z 8.4e-26))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-10) || !(z <= 8.4e-26)) {
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.75d-10)) .or. (.not. (z <= 8.4d-26))) 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.75e-10) || !(z <= 8.4e-26)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-10) or not (z <= 8.4e-26): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-10) || !(z <= 8.4e-26)) 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.75e-10) || ~((z <= 8.4e-26))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-10], N[Not[LessEqual[z, 8.4e-26]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-10} \lor \neg \left(z \leq 8.4 \cdot 10^{-26}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.7499999999999999e-10 or 8.40000000000000032e-26 < z Initial program 77.5%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 71.4%
if -1.7499999999999999e-10 < z < 8.40000000000000032e-26Initial program 98.9%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around inf 59.1%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (- x (* t (* (/ -1.0 (- z a)) (- z y)))))
double code(double x, double y, double z, double t, double a) {
return x - (t * ((-1.0 / (z - a)) * (z - y)));
}
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 * (((-1.0d0) / (z - a)) * (z - y)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (t * ((-1.0 / (z - a)) * (z - y)));
}
def code(x, y, z, t, a): return x - (t * ((-1.0 / (z - a)) * (z - y)))
function code(x, y, z, t, a) return Float64(x - Float64(t * Float64(Float64(-1.0 / Float64(z - a)) * Float64(z - y)))) end
function tmp = code(x, y, z, t, a) tmp = x - (t * ((-1.0 / (z - a)) * (z - y))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(t * N[(N[(-1.0 / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - t \cdot \left(\frac{-1}{z - a} \cdot \left(z - y\right)\right)
\end{array}
Initial program 87.3%
associate-*r/96.3%
*-commutative96.3%
div-inv96.2%
associate-*l*98.8%
Applied egg-rr98.8%
Final simplification98.8%
(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 87.3%
associate-/l*96.3%
Simplified96.3%
Final simplification96.3%
(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 87.3%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in x around inf 53.0%
Final simplification53.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 2024115
(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))))